keepSecondary property

bool keepSecondary
final

When using useKeyColors, set keepSecondary to true, to keep the resulting ColorScheme.secondary color as defined by effective FlexColorScheme.secondary input key color, while still letting all other colors derived from input primary key to be based on colors seeded from it.

This feature is useful if you want to lock the resulting ColorScheme.secondary to an exact given color value, but still use this color as branding key for all other color values derived from secondary key color. Typically you would use this when the secondary color must match a given established brand color, typically in light theme mode where it can be used since the color is often designed to be printed on white paper.

When you use the secondary color as input as key based color input for a tonal palette, the TonalPalette and from key based ColorScheme algorithm will typically not not return this exact color as the ColorScheme.secondary color. Seed colors are used more as a way to "set the tone" for the desired theme, the exact same input color value will seldom become the actual ColorScheme.secondary color. With keepSecondary set to true you can however enforce that.

Defaults to false.

Implementation

final bool keepSecondary;