testTheme function
MantleTheme
testTheme({
- MantleColors? colors,
- MantleIcons? icons,
- MantleTypography? typography,
- MantleSpacing? spacing,
- MantleRadius? radius,
- MantleShadow? shadows,
- MantleBreakpoint? breakpoints,
- DelegateRegistry? components,
- ComponentDefaults? componentDefaults,
- String? debugName,
- String? primaryColor,
- MantleShade? primaryShade,
- MantleSize? defaultRadius,
- MantleGradient? defaultGradient,
- MantleTheme? baseline,
Compact theme for tests. Includes blue, red, and gray palettes.
Implementation
MantleTheme testTheme({
MantleColors? colors,
MantleIcons? icons,
MantleTypography? typography,
MantleSpacing? spacing,
MantleRadius? radius,
MantleShadow? shadows,
MantleBreakpoint? breakpoints,
DelegateRegistry? components,
ComponentDefaults? componentDefaults,
String? debugName,
String? primaryColor,
MantleShade? primaryShade,
MantleSize? defaultRadius,
MantleGradient? defaultGradient,
MantleTheme? baseline,
}) {
final theme = MantleTheme(
colors:
colors ??
MantleColors({
'blue': mantleTestPalette(0),
'red': mantleTestPalette(200),
'gray': mantleTestPalette(120),
}),
icons: icons ?? const MantleIcons.empty(),
typography: typography ?? const MantleTypography.empty(),
spacing: spacing ?? const MantleSpacing.empty(),
radius: radius ?? MantleRadius(const {'sm': 4, 'md': 8, 'lg': 16}),
shadows: shadows ?? const MantleShadow.empty(),
breakpoints: breakpoints ?? const MantleBreakpoint.empty(),
components: components ?? const DelegateRegistry.empty(),
componentDefaults: componentDefaults ?? const ComponentDefaults.empty(),
debugName: debugName,
primaryColor: primaryColor ?? 'blue',
primaryShade: primaryShade,
defaultRadius: defaultRadius ?? 'md',
defaultGradient: defaultGradient,
);
return baseline == null ? theme : theme.bindBaseline(baseline);
}