FlexSchemeColor.from constructor
FlexSchemeColor.from({})
Make a FlexSchemeColor from just one primary color or possible also from a more complete color scheme set. This is a convenience factory that can create a nice toned color schemes based on only the primary color.
Implementation
factory FlexSchemeColor.from({
required Color primary,
Color? primaryVariant,
Color? secondary,
Color? secondaryVariant,
Color? appBarColor,
Color? error,
}) {
return FlexSchemeColor(
primary: primary,
// ignore: avoid_redundant_argument_values
primaryVariant: primaryVariant ?? primary.darken(kDarkenPrimaryVariant),
secondary: secondary ?? primary.darken(kDarkenSecondary),
secondaryVariant: secondaryVariant ??
// ignore: avoid_redundant_argument_values
secondary?.darken(kDarkenSecondaryVariantFromSecondary) ??
primary.darken(kDarkenSecondaryVariant),
appBarColor: appBarColor ??
// ignore: avoid_redundant_argument_values
secondary?.darken(kDarkenSecondaryVariantFromSecondary) ??
primary.darken(kDarkenSecondaryVariant),
// Accent color defaults to primary if not defined.
// accentColor: accentColor ?? primary,
error: error,
);
}