colorScheme property

ColorScheme? colorScheme
final

The overall ColorScheme based colors for the theme.

This property provides a new 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. This will become particularly useful when using Material 3 based design and its seed generated color schemes.

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

If you do not define a color scheme, the individual color value properties and their defaults are used to define your effective color scheme.

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, which is particularly useful when using the FlexColorScheme.light and FlexColorScheme.dark factories to compute color scheme branded surface colors for you. The effective ColorScheme for your theme is often needed if you want to create custom sub-themes that should use the colors from the scheme using none default color assignments from the color scheme.

Implementation

final ColorScheme? colorScheme;