MaterialTheme class
A resolved Material 3 theme: what Theme.of(context) would return.
The default is ThemeData() (the M3 baseline), transcribed from the
Flutter SDK. ThemeExtractor builds one from the app's ThemeData.
Constructors
-
MaterialTheme({ThemeBrightness brightness = ThemeBrightness.light, String fontFamily = 'Roboto', Map<
String, int> colorScheme = m3LightColorScheme, Map<String, TextStyleSpec> textTheme = m3TextTheme, IrColor? scaffoldBackground, AppBarThemeSpec appBar = const AppBarThemeSpec(), CardThemeSpec card = const CardThemeSpec(), Map<String, Map< buttonStyles = const {}, bool tapTargetPadded = true})String, DartValue> > -
const
- MaterialTheme.baseline(ThemeBrightness b)
-
ThemeData(brightness: b)with no other arguments.factory
Properties
- appBar → AppBarThemeSpec
-
final
- brightness → ThemeBrightness
-
final
-
elevatedButtonThemeetc.: button type →ButtonStylearguments.final - card → CardThemeSpec
-
final
-
colorScheme
→ Map<
String, int> -
Every
ColorSchemerole as ARGB.final - fontFamily → String
-
Font used when a text style names none.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDark → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaffoldBackground → IrColor?
-
final
-
shadowTokens
→ List<
IrShadowToken> -
Effect style tokens for the M3 elevation levels.
no setter
- tapTargetPadded → bool
-
ThemeData.materialTapTargetSize: padded (48 px tap targets, the default on phones) unless the app setsshrinkWrap.final -
textTheme
→ Map<
String, TextStyleSpec> -
Localized text theme entries (geometry + family + user overrides).
Colors are only present when the app set them; see textStyle.
final
Methods
-
color(
String role) → IrColor - A color scheme role, tagged with its design token.
-
maybeColor(
String role) → IrColor? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shadows(
double elevation) → List< IrShadow> - Figma approximation of Material 3 elevation levels (M3 design kit).
-
shadowToken(
List< IrShadow> shadows) → String? -
The elevation token
shadowswas produced from, if any. -
textStyle(
String name) → TextStyleSpec? -
A text theme entry as widgets see it. M3 typography colors every style
onSurfaceunless the app's text theme says otherwise. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
colorToken(
String role) → String -
textStyleName(
String? token) → String? -
The text theme entry name for a
TextTheme/...token. -
textToken(
String name) → String
Constants
-
elevationLevels
→ const List<
double> - Elevations representative of M3 levels 1–5 (see shadows).