copyWith method

  1. @override
Chrome copyWith({
  1. MaterialColor? swatch,
  2. Color? foreground,
  3. Color? background,
  4. Color? primary,
  5. Color? secondary,
  6. Color? ascent,
  7. Color? onPrimary,
  8. Color? onSecondary,
  9. Color? onAscent,
  10. Color? success,
  11. Color? error,
  12. Color? warning,
  13. Color? shade,
  14. 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,
  );
}