FlexColorScheme constructor

const FlexColorScheme({
  1. ColorScheme? colorScheme,
  2. Brightness? brightness,
  3. Color? primary,
  4. Color? primaryVariant,
  5. Color? secondary,
  6. Color? secondaryVariant,
  7. Color? error,
  8. Color? surface,
  9. Color? background,
  10. Color? scaffoldBackground,
  11. Color? dialogBackground,
  12. Color? appBarBackground,
  13. Color? onPrimary,
  14. Color? onSecondary,
  15. Color? onSurface,
  16. Color? onBackground,
  17. Color? onError,
  18. FlexTabBarStyle tabBarStyle = FlexTabBarStyle.forAppBar,
  19. double appBarElevation = 0,
  20. double bottomAppBarElevation = 0,
  21. bool tooltipsMatchBackground = false,
  22. bool transparentStatusBar = true,
  23. VisualDensity? visualDensity,
  24. TextTheme? textTheme,
  25. TextTheme? primaryTextTheme,
  26. String? fontFamily,
  27. TargetPlatform? platform,
  28. Typography? typography,
  29. bool applyElevationOverlayColor = true,
  30. bool useSubThemes = false,
  31. FlexSubThemesData? subThemesData,
})

Default constructor that 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.

Implementation

const FlexColorScheme({
  final this.colorScheme,
  final this.brightness,
  final this.primary,
  final this.primaryVariant,
  final this.secondary,
  final this.secondaryVariant,
  final this.error,
  final this.surface,
  final this.background,
  final this.scaffoldBackground,
  final this.dialogBackground,
  final this.appBarBackground,
  final this.onPrimary,
  final this.onSecondary,
  final this.onSurface,
  final this.onBackground,
  final this.onError,
  final this.tabBarStyle = FlexTabBarStyle.forAppBar,
  final this.appBarElevation = 0,
  final this.bottomAppBarElevation = 0,
  final this.tooltipsMatchBackground = false,
  final this.transparentStatusBar = true,
  final this.visualDensity,
  final this.textTheme,
  final this.primaryTextTheme,
  final this.fontFamily,
  final this.platform,
  final this.typography,
  final this.applyElevationOverlayColor = true,
  final this.useSubThemes = false,
  final this.subThemesData,
})  : assert(appBarElevation >= 0.0, 'AppBar elevation must be >= 0.'),
      assert(bottomAppBarElevation >= 0.0,
          'Bottom AppBar elevation must be >= 0.');