copyWith method

Theme copyWith({
  1. Color? primary,
  2. Color? secondary,
  3. Color? surface,
  4. Color? background,
  5. Color? error,
  6. Color? success,
  7. Color? warning,
  8. Color? onPrimary,
  9. Color? onSecondary,
  10. Color? onSurface,
  11. Color? onBackground,
  12. Color? onError,
  13. Color? muted,
  14. Color? border,
  15. Color? surfaceVariant,
  16. Color? onSurfaceVariant,
  17. Color? outline,
  18. Color? info,
  19. Color? onSuccess,
  20. Color? onWarning,
  21. Color? onInfo,
  22. Color? highlight,
  23. Color? onHighlight,
  24. Color? shadow,
  25. Style? titleLarge,
  26. Style? titleMedium,
  27. Style? titleSmall,
  28. Style? bodyLarge,
  29. Style? bodyMedium,
  30. Style? bodySmall,
  31. Style? labelLarge,
  32. Style? labelMedium,
  33. Style? labelSmall,
  34. StatusBarThemeData? statusBarTheme,
  35. AccentPanelThemeData? accentPanelTheme,
  36. CommandPaletteThemeData? commandPaletteTheme,
  37. DialogThemeData? dialogTheme,
  38. 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,
  );
}