copyWith method
Theme
copyWith({
- Color? primary,
- Color? secondary,
- Color? surface,
- Color? background,
- Color? error,
- Color? success,
- Color? warning,
- Color? onPrimary,
- Color? onSecondary,
- Color? onSurface,
- Color? onBackground,
- Color? onError,
- Color? muted,
- Color? border,
- Color? surfaceVariant,
- Color? onSurfaceVariant,
- Color? outline,
- Color? info,
- Color? onSuccess,
- Color? onWarning,
- Color? onInfo,
- Color? highlight,
- Color? onHighlight,
- Color? shadow,
- Style? titleLarge,
- Style? titleMedium,
- Style? titleSmall,
- Style? bodyLarge,
- Style? bodyMedium,
- Style? bodySmall,
- Style? labelLarge,
- Style? labelMedium,
- Style? labelSmall,
- StatusBarThemeData? statusBarTheme,
- AccentPanelThemeData? accentPanelTheme,
- CommandPaletteThemeData? commandPaletteTheme,
- DialogThemeData? dialogTheme,
- GitDiffThemeData? gitDiffTheme,
Copy this theme with some values changed.
Implementation
Theme copyWith({
// Core semantic colors
Color? primary,
Color? secondary,
Color? surface,
Color? background,
Color? error,
Color? success,
Color? warning,
Color? onPrimary,
Color? onSecondary,
Color? onSurface,
Color? onBackground,
Color? onError,
Color? muted,
Color? border,
// Extended semantic colors
Color? surfaceVariant,
Color? onSurfaceVariant,
Color? outline,
Color? info,
Color? onSuccess,
Color? onWarning,
Color? onInfo,
Color? highlight,
Color? onHighlight,
Color? shadow,
// Text styles
Style? titleLarge,
Style? titleMedium,
Style? titleSmall,
Style? bodyLarge,
Style? bodyMedium,
Style? bodySmall,
Style? labelLarge,
Style? labelMedium,
Style? labelSmall,
// Component themes
StatusBarThemeData? statusBarTheme,
AccentPanelThemeData? accentPanelTheme,
CommandPaletteThemeData? commandPaletteTheme,
DialogThemeData? dialogTheme,
GitDiffThemeData? gitDiffTheme,
}) {
return Theme(
primary: primary ?? this.primary,
secondary: secondary ?? this.secondary,
surface: surface ?? this.surface,
background: background ?? this.background,
error: error ?? this.error,
success: success ?? this.success,
warning: warning ?? this.warning,
onPrimary: onPrimary ?? this.onPrimary,
onSecondary: onSecondary ?? this.onSecondary,
onSurface: onSurface ?? this.onSurface,
onBackground: onBackground ?? this.onBackground,
onError: onError ?? this.onError,
muted: muted ?? this.muted,
border: border ?? this.border,
surfaceVariant: surfaceVariant ?? this.surfaceVariant,
onSurfaceVariant: onSurfaceVariant ?? this.onSurfaceVariant,
outline: outline ?? this.outline,
info: info ?? this.info,
onSuccess: onSuccess ?? this.onSuccess,
onWarning: onWarning ?? this.onWarning,
onInfo: onInfo ?? this.onInfo,
highlight: highlight ?? this.highlight,
onHighlight: onHighlight ?? this.onHighlight,
shadow: shadow ?? this.shadow,
titleLarge: titleLarge ?? this.titleLarge,
titleMedium: titleMedium ?? this.titleMedium,
titleSmall: titleSmall ?? this.titleSmall,
bodyLarge: bodyLarge ?? this.bodyLarge,
bodyMedium: bodyMedium ?? this.bodyMedium,
bodySmall: bodySmall ?? this.bodySmall,
labelLarge: labelLarge ?? this.labelLarge,
labelMedium: labelMedium ?? this.labelMedium,
labelSmall: labelSmall ?? this.labelSmall,
statusBarTheme: statusBarTheme ?? this.statusBarTheme,
accentPanelTheme: accentPanelTheme ?? this.accentPanelTheme,
commandPaletteTheme: commandPaletteTheme ?? this.commandPaletteTheme,
dialogTheme: dialogTheme ?? this.dialogTheme,
gitDiffTheme: gitDiffTheme ?? this.gitDiffTheme,
);
}