copyWith method

ColorScheme copyWith({
  1. Brightness? brightness,
  2. Color? primary,
  3. Color? onPrimary,
  4. Color? primaryContainer,
  5. Color? onPrimaryContainer,
  6. Color? primaryFixed,
  7. Color? primaryFixedDim,
  8. Color? onPrimaryFixed,
  9. Color? onPrimaryFixedVariant,
  10. Color? secondary,
  11. Color? onSecondary,
  12. Color? secondaryContainer,
  13. Color? onSecondaryContainer,
  14. Color? secondaryFixed,
  15. Color? secondaryFixedDim,
  16. Color? onSecondaryFixed,
  17. Color? onSecondaryFixedVariant,
  18. Color? tertiary,
  19. Color? onTertiary,
  20. Color? tertiaryContainer,
  21. Color? onTertiaryContainer,
  22. Color? tertiaryFixed,
  23. Color? tertiaryFixedDim,
  24. Color? onTertiaryFixed,
  25. Color? onTertiaryFixedVariant,
  26. Color? error,
  27. Color? onError,
  28. Color? errorContainer,
  29. Color? onErrorContainer,
  30. Color? surface,
  31. Color? onSurface,
  32. Color? surfaceDim,
  33. Color? surfaceBright,
  34. Color? surfaceContainerLowest,
  35. Color? surfaceContainerLow,
  36. Color? surfaceContainer,
  37. Color? surfaceContainerHigh,
  38. Color? surfaceContainerHighest,
  39. Color? onSurfaceVariant,
  40. Color? outline,
  41. Color? outlineVariant,
  42. Color? shadow,
  43. Color? scrim,
  44. Color? inverseSurface,
  45. Color? onInverseSurface,
  46. Color? inversePrimary,
  47. Color? surfaceTint,
  48. @Deprecated('Use surface instead. ' 'This feature was deprecated after v3.18.0-0.1.pre.') Color? background,
  49. @Deprecated('Use onSurface instead. ' 'This feature was deprecated after v3.18.0-0.1.pre.') Color? onBackground,
  50. @Deprecated('Use surfaceContainerHighest instead. ' 'This feature was deprecated after v3.18.0-0.1.pre.') Color? surfaceVariant,
})

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? primaryFixed,
  Color? primaryFixedDim,
  Color? onPrimaryFixed,
  Color? onPrimaryFixedVariant,
  Color? secondary,
  Color? onSecondary,
  Color? secondaryContainer,
  Color? onSecondaryContainer,
  Color? secondaryFixed,
  Color? secondaryFixedDim,
  Color? onSecondaryFixed,
  Color? onSecondaryFixedVariant,
  Color? tertiary,
  Color? onTertiary,
  Color? tertiaryContainer,
  Color? onTertiaryContainer,
  Color? tertiaryFixed,
  Color? tertiaryFixedDim,
  Color? onTertiaryFixed,
  Color? onTertiaryFixedVariant,
  Color? error,
  Color? onError,
  Color? errorContainer,
  Color? onErrorContainer,
  Color? surface,
  Color? onSurface,
  Color? surfaceDim,
  Color? surfaceBright,
  Color? surfaceContainerLowest,
  Color? surfaceContainerLow,
  Color? surfaceContainer,
  Color? surfaceContainerHigh,
  Color? surfaceContainerHighest,
  Color? onSurfaceVariant,
  Color? outline,
  Color? outlineVariant,
  Color? shadow,
  Color? scrim,
  Color? inverseSurface,
  Color? onInverseSurface,
  Color? inversePrimary,
  Color? surfaceTint,
  @Deprecated(
    'Use surface instead. '
    'This feature was deprecated after v3.18.0-0.1.pre.'
  )
  Color? background,
  @Deprecated(
    'Use onSurface instead. '
    'This feature was deprecated after v3.18.0-0.1.pre.'
  )
  Color? onBackground,
  @Deprecated(
    'Use surfaceContainerHighest instead. '
    'This feature was deprecated after v3.18.0-0.1.pre.'
  )
  Color? surfaceVariant,
}) {
  return ColorScheme(
    brightness: brightness ?? this.brightness,
    primary : primary ?? this.primary,
    onPrimary : onPrimary ?? this.onPrimary,
    primaryContainer : primaryContainer ?? this.primaryContainer,
    onPrimaryContainer : onPrimaryContainer ?? this.onPrimaryContainer,
    primaryFixed: primaryFixed ?? this.primaryFixed,
    primaryFixedDim: primaryFixedDim ?? this.primaryFixedDim,
    onPrimaryFixed: onPrimaryFixed ?? this.onPrimaryFixed,
    onPrimaryFixedVariant: onPrimaryFixedVariant ?? this.onPrimaryFixedVariant,
    secondary : secondary ?? this.secondary,
    onSecondary : onSecondary ?? this.onSecondary,
    secondaryContainer : secondaryContainer ?? this.secondaryContainer,
    onSecondaryContainer : onSecondaryContainer ?? this.onSecondaryContainer,
    secondaryFixed: secondaryFixed ?? this.secondaryFixed,
    secondaryFixedDim: secondaryFixedDim ?? this.secondaryFixedDim,
    onSecondaryFixed: onSecondaryFixed ?? this.onSecondaryFixed,
    onSecondaryFixedVariant: onSecondaryFixedVariant ?? this.onSecondaryFixedVariant,
    tertiary : tertiary ?? this.tertiary,
    onTertiary : onTertiary ?? this.onTertiary,
    tertiaryContainer : tertiaryContainer ?? this.tertiaryContainer,
    onTertiaryContainer : onTertiaryContainer ?? this.onTertiaryContainer,
    tertiaryFixed: tertiaryFixed ?? this.tertiaryFixed,
    tertiaryFixedDim: tertiaryFixedDim ?? this.tertiaryFixedDim,
    onTertiaryFixed: onTertiaryFixed ?? this.onTertiaryFixed,
    onTertiaryFixedVariant: onTertiaryFixedVariant ?? this.onTertiaryFixedVariant,
    error : error ?? this.error,
    onError : onError ?? this.onError,
    errorContainer : errorContainer ?? this.errorContainer,
    onErrorContainer : onErrorContainer ?? this.onErrorContainer,
    surface : surface ?? this.surface,
    onSurface : onSurface ?? this.onSurface,
    surfaceDim : surfaceDim ?? this.surfaceDim,
    surfaceBright : surfaceBright ?? this.surfaceBright,
    surfaceContainerLowest : surfaceContainerLowest ?? this.surfaceContainerLowest,
    surfaceContainerLow : surfaceContainerLow ?? this.surfaceContainerLow,
    surfaceContainer : surfaceContainer ?? this.surfaceContainer,
    surfaceContainerHigh : surfaceContainerHigh ?? this.surfaceContainerHigh,
    surfaceContainerHighest : surfaceContainerHighest ?? this.surfaceContainerHighest,
    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,
    // DEPRECATED (newest deprecations at the bottom)
    background : background ?? this.background,
    onBackground : onBackground ?? this.onBackground,
    surfaceVariant : surfaceVariant ?? this.surfaceVariant,
  );
}