ThemeData class final

The themeable defaults shared down the tree via Theme.

Semantic roles provide framework defaults. Interactive control styles cascade from widget defaults through interactiveStyle to the widget's local style, merging base paint while preserving inherited state cues. The default ThemeData reproduces the framework's built-in appearance, so a Theme changes nothing until one of its fields is customized.

Constructors

ThemeData({Brightness brightness = Brightness.dark, CellStyle textStyle = CellStyle.none, CellStyle mutedStyle = const CellStyle(dim: true), CellStyle selectionStyle = const CellStyle(inverse: true), CellStyle focusedStyle = const CellStyle(bold: true), CellStyle errorStyle = const CellStyle(foreground: Colors.red, underline: true), CellStyle? interactiveStyle, BorderStyle borderStyle = BorderStyle.rounded, ColorScheme colorScheme = ColorScheme.standard, List<Object> extensions = const []})
const
ThemeData.dark({List<Object> extensions = const []})
A preset accent tuned for dark terminals (the common case).
factory
ThemeData.light({List<Object> extensions = const []})
A preset accent tuned for light terminals.
factory

Properties

borderStyle → BorderStyle
Default box-drawing style for framed surfaces.
final
brightness → Brightness
Dark or light tuning — a hint for app/extension color choices.
final
colorScheme → ColorScheme
Semantic colors.
final
errorStyle → CellStyle
Invalid-control and validation-message style.
final
extensions → List<Object>
Typed, app-defined theme extensions. Unlike Flutter's ThemeExtension, an extension here is any plain object — no mandatory copyWith/lerp/== boilerplate. Retrieve one by type with extension; the first assignable entry wins.
final
focusedStyle → CellStyle
Attribute cue for a focused control (bold). Pair with ColorScheme.focus for a colored focus that still reads under NO_COLOR — the color drops, this attribute remains.
final
hashCode → int
The hash code for this object.
no setteroverride
interactiveStyle → CellStyle?
App-wide styling for shared action- and form-control states.
final
mutedStyle → CellStyle
Attribute cue for de-emphasized text (dim) — separators, hints, disabled rows. Survives NO_COLOR, so prefer it (optionally with a muted color) to a raw gray palette index.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectionStyle → CellStyle
Highlight for the selected/active row or item.
final
textStyle → CellStyle
Base style a Theme cascades onto the Text below it, as the DefaultTextStyle. Without a foreground of its own, that text takes ColorScheme.foreground.
final

Methods

adaptive<T>({required T light, required T dark}) → T
Picks a value for this theme's declared brightness.
copyWith({Brightness? brightness, CellStyle? textStyle, CellStyle? mutedStyle, CellStyle? selectionStyle, CellStyle? focusedStyle, CellStyle? errorStyle, CellStyle? interactiveStyle, BorderStyle? borderStyle, ColorScheme? colorScheme, List<Object>? extensions}) → ThemeData
extension<T extends Object>() → T?
The registered extension assignable to T, or null. O(n) over a handful of extensions.
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.
override

Constants

fallback → const ThemeData
Returned by Theme.of when no Theme is in scope. Matches the framework's built-in widget looks.