copyWith method

ColorScheme copyWith(
  1. {Brightness? brightness,
  2. Color? primary,
  3. Color? onPrimary,
  4. Color? primaryContainer,
  5. Color? onPrimaryContainer,
  6. Color? secondary,
  7. Color? onSecondary,
  8. Color? secondaryContainer,
  9. Color? onSecondaryContainer,
  10. Color? tertiary,
  11. Color? onTertiary,
  12. Color? tertiaryContainer,
  13. Color? onTertiaryContainer,
  14. Color? error,
  15. Color? onError,
  16. Color? errorContainer,
  17. Color? onErrorContainer,
  18. Color? background,
  19. Color? onBackground,
  20. Color? surface,
  21. Color? onSurface,
  22. Color? surfaceVariant,
  23. Color? onSurfaceVariant,
  24. Color? outline,
  25. Color? outlineVariant,
  26. Color? shadow,
  27. Color? scrim,
  28. Color? inverseSurface,
  29. Color? onInverseSurface,
  30. Color? inversePrimary,
  31. Color? surfaceTint}
)

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

Implementation

ColorScheme copyWith({
  Brightness? brightness,
  Color? primary,
  Color? onPrimary,
  Color? primaryContainer,
  Color? onPrimaryContainer,
  Color? secondary,
  Color? onSecondary,
  Color? secondaryContainer,
  Color? onSecondaryContainer,
  Color? tertiary,
  Color? onTertiary,
  Color? tertiaryContainer,
  Color? onTertiaryContainer,
  Color? error,
  Color? onError,
  Color? errorContainer,
  Color? onErrorContainer,
  Color? background,
  Color? onBackground,
  Color? surface,
  Color? onSurface,
  Color? surfaceVariant,
  Color? onSurfaceVariant,
  Color? outline,
  Color? outlineVariant,
  Color? shadow,
  Color? scrim,
  Color? inverseSurface,
  Color? onInverseSurface,
  Color? inversePrimary,
  Color? surfaceTint,
}) {
  return ColorScheme(
    brightness: brightness ?? this.brightness,
    primary : primary ?? this.primary,
    onPrimary : onPrimary ?? this.onPrimary,
    primaryContainer : primaryContainer ?? this.primaryContainer,
    onPrimaryContainer : onPrimaryContainer ?? this.onPrimaryContainer,
    secondary : secondary ?? this.secondary,
    onSecondary : onSecondary ?? this.onSecondary,
    secondaryContainer : secondaryContainer ?? this.secondaryContainer,
    onSecondaryContainer : onSecondaryContainer ?? this.onSecondaryContainer,
    tertiary : tertiary ?? this.tertiary,
    onTertiary : onTertiary ?? this.onTertiary,
    tertiaryContainer : tertiaryContainer ?? this.tertiaryContainer,
    onTertiaryContainer : onTertiaryContainer ?? this.onTertiaryContainer,
    error : error ?? this.error,
    onError : onError ?? this.onError,
    errorContainer : errorContainer ?? this.errorContainer,
    onErrorContainer : onErrorContainer ?? this.onErrorContainer,
    background : background ?? this.background,
    onBackground : onBackground ?? this.onBackground,
    surface : surface ?? this.surface,
    onSurface : onSurface ?? this.onSurface,
    surfaceVariant : surfaceVariant ?? this.surfaceVariant,
    onSurfaceVariant : onSurfaceVariant ?? this.onSurfaceVariant,
    outline : outline ?? this.outline,
    outlineVariant : outlineVariant ?? this.outlineVariant,
    shadow : shadow ?? this.shadow,
    scrim : scrim ?? this.scrim,
    inverseSurface : inverseSurface ?? this.inverseSurface,
    onInverseSurface : onInverseSurface ?? this.onInverseSurface,
    inversePrimary : inversePrimary ?? this.inversePrimary,
    surfaceTint: surfaceTint ?? this.surfaceTint,
  );
}