colorScheme property

ColorScheme? colorScheme
final

The overall ColorScheme based colors for the theme.

This property provides an alternative way to define custom colors for FlexColorScheme and is available from version 4.2.0. It is useful if you already have a custom ColorScheme based color definition that you want to use with FlexColorScheme theming and its sub-theming capabilities, often used with Material 3 based design and its seed generated color schemes.

The factories FlexColorScheme.light and FlexColorScheme.dark provide convenience factories for also generating M3 based seeded themes using the built-in FlexSchemeColor colors as seed color(s), or using custom color values you provide as seed colors.

If you provide both a ColorScheme and some individual direct property values that also exist in a ColorScheme, the direct property values will override the corresponding ones in your ColorScheme.

If you do not define a colorScheme, the individual color value properties and their defaults are used to define your effective FlexColorScheme and its resulting ColorScheme and ThemeData.

The FlexColorScheme's effective ColorScheme can be returned with toScheme. This will always get you a complete color scheme, including calculated and derived color values,. This can be used when using the FlexColorScheme.light and FlexColorScheme.dark factories to compute schemes with branded or tinted surface colors. The effective ColorScheme of your theme is often needed if you want to create component sub-themes that should use the colors from the scheme, with its color assignments computed from the input colors.

Implementation

final ColorScheme? colorScheme;