copyWith method Null safety
- {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? shadow,
- Color? inverseSurface,
- Color? onInverseSurface,
- Color? inversePrimary,
- Color? surfaceTint,
- @Deprecated('Use primary or primaryContainer instead. ' 'This feature was deprecated after v2.6.0-0.0.pre.') Color? primaryVariant,
- @Deprecated('Use secondary or secondaryContainer instead. ' 'This feature was deprecated after v2.6.0-0.0.pre.') Color? secondaryVariant}
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? shadow,
Color? inverseSurface,
Color? onInverseSurface,
Color? inversePrimary,
Color? surfaceTint,
@Deprecated(
'Use primary or primaryContainer instead. '
'This feature was deprecated after v2.6.0-0.0.pre.'
)
Color? primaryVariant,
@Deprecated(
'Use secondary or secondaryContainer instead. '
'This feature was deprecated after v2.6.0-0.0.pre.'
)
Color? secondaryVariant,
}) {
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,
shadow : shadow ?? this.shadow,
inverseSurface : inverseSurface ?? this.inverseSurface,
onInverseSurface : onInverseSurface ?? this.onInverseSurface,
inversePrimary : inversePrimary ?? this.inversePrimary,
primaryVariant: primaryVariant ?? this.primaryVariant,
secondaryVariant: secondaryVariant ?? this.secondaryVariant,
surfaceTint: surfaceTint ?? this.surfaceTint,
);
}