Theme class

Theme containing semantic colors, text styles, and component themes.

Constructors

Theme({required Color primary, required Color secondary, required Color surface, required Color background, required Color error, required Color success, required Color warning, required Color onPrimary, required Color onSecondary, required Color onSurface, required Color onBackground, required Color onError, required Color muted, required Color border, Color? surfaceVariant, Color? onSurfaceVariant, Color? outline, Color? info, Color? onSuccess, Color? onWarning, Color? onInfo, Color? highlight, Color? onHighlight, Color? shadow, required Style titleLarge, required Style titleMedium, required Style titleSmall, required Style bodyLarge, required Style bodyMedium, required Style bodySmall, required Style labelLarge, required Style labelMedium, required Style labelSmall, StatusBarThemeData? statusBarTheme, AccentPanelThemeData? accentPanelTheme, CommandPaletteThemeData? commandPaletteTheme, DialogThemeData? dialogTheme, GitDiffThemeData? gitDiffTheme})
const

Properties

accentPanelTheme AccentPanelThemeData?
Theme overrides for AccentPanel widgets.
final
background Color
Background color for the main area.
final
bodyLarge Style
Large body text style.
final
bodyMedium Style
Medium body text style.
final
bodySmall Style
Small body text style.
final
border Color
Border color.
final
commandPaletteTheme CommandPaletteThemeData?
Theme overrides for CommandPalette widgets.
final
dialogTheme DialogThemeData?
Theme overrides for dialog widgets.
final
error Color
Error/danger color.
final
gitDiffTheme GitDiffThemeData?
Theme overrides for GitDiffViewer widgets.
final
hashCode int
The hash code for this object.
no setterinherited
highlight Color?
Selection/highlight background color. Falls back to primary when null.
final
info Color?
Informational color (e.g., help text, info badges). Falls back to primary when null.
final
labelLarge Style
Large label style.
final
labelMedium Style
Medium label style.
final
labelSmall Style
Small label style (dimmed).
final
muted Color
Muted/dimmed text color.
final
onBackground Color
Text color on main background.
final
onError Color
Text color on error backgrounds.
final
onHighlight Color?
Text color on highlight backgrounds. Falls back to onPrimary when null.
final
onInfo Color?
Text color on info backgrounds. Falls back to onPrimary when null.
final
onPrimary Color
Text color on primary backgrounds.
final
onSecondary Color
Text color on secondary backgrounds.
final
onSuccess Color?
Text color on success backgrounds. Falls back to onPrimary when null.
final
onSurface Color
Text color on surface backgrounds.
final
onSurfaceVariant Color?
Text color on surfaceVariant backgrounds. Falls back to onSurface when null.
final
onWarning Color?
Text color on warning backgrounds. Falls back to onPrimary when null.
final
outline Color?
Subtle outline/divider color, lighter than border. Falls back to border when null.
final
primary Color
Primary accent color for interactive elements.
final
resolvedHighlight Color
Resolved highlight, falling back to primary.
no setter
resolvedInfo Color
Resolved info, falling back to primary.
no setter
resolvedOnHighlight Color
Resolved onHighlight, falling back to onPrimary.
no setter
resolvedOnInfo Color
Resolved onInfo, falling back to onPrimary.
no setter
resolvedOnSuccess Color
Resolved onSuccess, falling back to onPrimary.
no setter
resolvedOnSurfaceVariant Color
Resolved onSurfaceVariant, falling back to onSurface.
no setter
resolvedOnWarning Color
Resolved onWarning, falling back to onPrimary.
no setter
resolvedOutline Color
Resolved outline, falling back to border.
no setter
resolvedShadow Color
Resolved shadow, falling back to muted.
no setter
resolvedSurfaceVariant Color
Resolved surfaceVariant, falling back to surface.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondary Color
Secondary accent color for less prominent elements.
final
shadow Color?
Shadow/elevation hint color. Falls back to muted when null.
final
statusBarTheme StatusBarThemeData?
Theme overrides for StatusBar widgets.
final
success Color
Success color.
final
surface Color
Surface color for cards, panels, etc.
final
surfaceVariant Color?
Alternate surface color for visual differentiation (e.g., sidebar vs main). Falls back to surface when null.
final
titleLarge Style
Large title style.
final
titleMedium Style
Medium title style.
final
titleSmall Style
Small title style.
final
warning Color
Warning color.
final

Methods

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}) Theme
Copy this theme with some values changed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

adaptive() Theme
Adaptive theme that auto-switches based on terminal background.
dark() Theme
Dark theme with cyan accents.
light() Theme
Light theme with blue accents.