FlexSchemeColor constructor

const FlexSchemeColor({
  1. required Color primary,
  2. Color? primaryContainer,
  3. required Color secondary,
  4. Color? secondaryContainer,
  5. Color? tertiary,
  6. Color? tertiaryContainer,
  7. Color? appBarColor,
  8. Color? error,
  9. Color? errorContainer,
  10. bool swapOnMaterial3 = false,
})

Default constructor, that requires the main four colors.

Consider using the FlexSchemeColor.from factory constructor for more flexibility and less required values based on using computed defaults for missing, but required values in a complete FlexSchemeColor.

If you are defining all four required color values, then prefer using this default constructor as it can be const.

The appBarColor and error colors are not required, if they are null, they will be provided by defaults in theme creation later.

Implementation

const FlexSchemeColor({
  required this.primary,
  Color? primaryContainer,
  required this.secondary,
  Color? secondaryContainer,
  Color? tertiary,
  Color? tertiaryContainer,
  this.appBarColor,
  this.error,
  this.errorContainer,
  this.swapOnMaterial3 = false,
})  : _primaryContainer = primaryContainer,
      _secondaryContainer = secondaryContainer,
      _tertiary = tertiary,
      _tertiaryContainer = tertiaryContainer;