copyWith method

  1. @useResult
FColorScheme copyWith({
  1. Brightness? brightness,
  2. Color? barrier,
  3. Color? background,
  4. Color? foreground,
  5. Color? primary,
  6. Color? primaryForeground,
  7. Color? secondary,
  8. Color? secondaryForeground,
  9. Color? muted,
  10. Color? mutedForeground,
  11. Color? destructive,
  12. Color? destructiveForeground,
  13. Color? error,
  14. Color? errorForeground,
  15. Color? border,
  16. double? enabledHoveredOpacity,
  17. double? disabledOpacity,
})

Returns a copy of this FColorScheme with the given properties replaced.

final scheme = FColorScheme(
  brightness: Brightness.light,
  background: Colors.blue,
  // Other arguments omitted for brevity
);

final copy = scheme.copyWith(brightness: Brightness.dark);

print(copy.brightness); // Brightness.dark
print(copy.background); // Colors.blue

Implementation

@useResult
FColorScheme copyWith({
  Brightness? brightness,
  Color? barrier,
  Color? background,
  Color? foreground,
  Color? primary,
  Color? primaryForeground,
  Color? secondary,
  Color? secondaryForeground,
  Color? muted,
  Color? mutedForeground,
  Color? destructive,
  Color? destructiveForeground,
  Color? error,
  Color? errorForeground,
  Color? border,
  double? enabledHoveredOpacity,
  double? disabledOpacity,
}) =>
    FColorScheme(
      brightness: brightness ?? this.brightness,
      barrier: barrier ?? this.barrier,
      background: background ?? this.background,
      foreground: foreground ?? this.foreground,
      primary: primary ?? this.primary,
      primaryForeground: primaryForeground ?? this.primaryForeground,
      secondary: secondary ?? this.secondary,
      secondaryForeground: secondaryForeground ?? this.secondaryForeground,
      muted: muted ?? this.muted,
      mutedForeground: mutedForeground ?? this.mutedForeground,
      destructive: destructive ?? this.destructive,
      destructiveForeground: destructiveForeground ?? this.destructiveForeground,
      error: error ?? this.error,
      errorForeground: errorForeground ?? this.errorForeground,
      border: border ?? this.border,
      enabledHoveredOpacity: enabledHoveredOpacity ?? this.enabledHoveredOpacity,
      disabledOpacity: disabledOpacity ?? this.disabledOpacity,
    );