FlexColorScheme constructor
- Brightness? brightness,
- ColorScheme? colorScheme,
- Color? primary,
- Color? onPrimary,
- Color? primaryContainer,
- Color? onPrimaryContainer,
- Color? secondary,
- Color? onSecondary,
- Color? secondaryContainer,
- Color? onSecondaryContainer,
- Color? tertiary,
- Color? onTertiary,
- Color? tertiaryContainer,
- Color? onTertiaryContainer,
- Color? error,
- Color? onError,
- Color? errorContainer,
- Color? onErrorContainer,
- Color? surface,
- Color? onSurface,
- Color? scaffoldBackground,
- Color? dialogBackground,
- Color? appBarBackground,
- Color? surfaceTint,
- FlexTabBarStyle? tabBarStyle,
- double? appBarElevation,
- double? bottomAppBarElevation,
- bool tooltipsMatchBackground = false,
- bool transparentStatusBar = true,
- VisualDensity? visualDensity,
- TextTheme? textTheme,
- TextTheme? primaryTextTheme,
- String? fontFamily,
- List<
String> ? fontFamilyFallback, - String? package,
- MaterialTapTargetSize? materialTapTargetSize,
- PageTransitionsTheme? pageTransitionsTheme,
- InteractiveInkFeatureFactory? splashFactory,
- TargetPlatform? platform,
- Typography? typography,
- bool applyElevationOverlayColor = true,
- NoDefaultCupertinoThemeData? cupertinoOverrideTheme,
- FlexSubThemesData? subThemesData,
- bool useMaterial3 = true,
- Iterable<
ThemeExtension> ? extensions, - @Deprecated('Use FlexColorScheme.surface instead. It is deprecated ' 'because Flutter 3.22 deprecated this ColorScheme color. ' 'It no longer has any function in FCS v8 and will be removed in v9.') Color? background,
- @Deprecated('Use FlexColorScheme.onSurface instead. It is deprecated ' 'because Flutter 3.22 deprecated this ColorScheme color. ' 'It no longer has any function in FCS v8 and will be removed in v9.') Color? onBackground,
Default constructor with no required properties.
Creates a a light theme by default using the M2 colors as its default theme.
Typically you would define
requires brightness
and four main color scheme
color properties in order to make a fully defined color scheme for
a ThemeData object.
For more convenient usage of FlexColorScheme consider using its two factory constructors FlexColorScheme.light and FlexColorScheme.dark, that can create schemes using defaults and computed color values, with custom overrides as needed.
The two factories also contain additional properties that can be used to create color branded surfaces, toggle the AppBarTheme between a few styles, and to make dark themes that use true black backgrounds and surfaces. As well as using FlexKeyColors and FlexTones to make and customize key color seed generated ColorSchemes.
Implementation
const FlexColorScheme({
this.brightness,
this.colorScheme,
//
this.primary,
this.onPrimary,
this.primaryContainer,
this.onPrimaryContainer,
//
this.secondary,
this.onSecondary,
this.secondaryContainer,
this.onSecondaryContainer,
//
this.tertiary,
this.onTertiary,
this.tertiaryContainer,
this.onTertiaryContainer,
//
this.error,
this.onError,
this.errorContainer,
this.onErrorContainer,
//
this.surface,
this.onSurface,
this.scaffoldBackground,
this.dialogBackground,
this.appBarBackground,
this.surfaceTint,
//
this.tabBarStyle,
this.appBarElevation,
this.bottomAppBarElevation,
this.tooltipsMatchBackground = false,
this.transparentStatusBar = true,
this.visualDensity,
this.textTheme,
this.primaryTextTheme,
this.fontFamily,
this.fontFamilyFallback,
this.package,
this.materialTapTargetSize,
this.pageTransitionsTheme,
this.splashFactory,
this.platform,
this.typography,
this.applyElevationOverlayColor = true,
this.cupertinoOverrideTheme,
this.subThemesData,
this.useMaterial3 = true,
this.extensions,
//
@Deprecated('Use FlexColorScheme.surface instead. It is deprecated '
'because Flutter 3.22 deprecated this ColorScheme color. '
'It no longer has any function in FCS v8 and will be removed in v9.')
this.background,
@Deprecated('Use FlexColorScheme.onSurface instead. It is deprecated '
'because Flutter 3.22 deprecated this ColorScheme color. '
'It no longer has any function in FCS v8 and will be removed in v9.')
this.onBackground,
}) : assert(appBarElevation == null || appBarElevation >= 0.0,
'AppBar elevation must be >= 0 or null.'),
assert(bottomAppBarElevation == null || bottomAppBarElevation >= 0.0,
'Bottom AppBar elevation must be >= 0 or null.');