copyWith method
Chrome
copyWith({
- MaterialColor? swatch,
- Color? foreground,
- Color? background,
- Color? primary,
- Color? secondary,
- Color? ascent,
- Color? onPrimary,
- Color? onSecondary,
- Color? onAscent,
- Color? success,
- Color? error,
- Color? warning,
- Color? shade,
- Color? tint,
override
Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.
Implementation
@override
Chrome copyWith({
MaterialColor? swatch,
Color? foreground,
Color? background,
//...surface
Color? primary,
Color? secondary,
Color? ascent,
//...on surface
Color? onPrimary,
Color? onSecondary,
Color? onAscent,
//...extras
Color? success,
Color? error,
Color? warning,
Color? shade,
Color? tint,
}) {
//...
return Chrome(
swatch: swatch ?? _swatch,
foreground: foreground ?? this.foreground,
background: background ?? this.background,
//...surface
primary: primary ?? this.primary,
secondary: secondary ?? this.secondary,
ascent: ascent ?? this.ascent,
//...on surface
onPrimary: onPrimary ?? _primary,
onSecondary: onSecondary ?? _secondary,
onAscent: onAscent ?? _ascent,
//...extras
success: success ?? this.success,
error: error ?? this.error,
warning: warning ?? this.warning,
shade: shade ?? this.shade,
tint: tint ?? this.tint,
);
}