copyWith method

ColorScheme copyWith ({Color primary, Color primaryVariant, Color secondary, Color secondaryVariant, Color surface, Color background, Color error, Color onPrimary, Color onSecondary, Color onSurface, Color onBackground, Color onError, Brightness brightness })

Creates a copy of this color scheme with the given fields replaced by the non-null parameter values.

Implementation

ColorScheme copyWith({
  Color primary,
  Color primaryVariant,
  Color secondary,
  Color secondaryVariant,
  Color surface,
  Color background,
  Color error,
  Color onPrimary,
  Color onSecondary,
  Color onSurface,
  Color onBackground,
  Color onError,
  Brightness brightness,
}) {
  return ColorScheme(
    primary: primary ?? this.primary,
    primaryVariant: primaryVariant ?? this.primaryVariant,
    secondary: secondary ?? this.secondary,
    secondaryVariant: secondaryVariant ?? this.secondaryVariant,
    surface: surface ?? this.surface,
    background: background ?? this.background,
    error: error ?? this.error,
    onPrimary: onPrimary ?? this.onPrimary,
    onSecondary: onSecondary ?? this.onSecondary,
    onSurface: onSurface ?? this.onSurface,
    onBackground: onBackground ?? this.onBackground,
    onError: onError ?? this.onError,
    brightness: brightness ?? this.brightness,
  );
}