ExpressiveThemeData class
One Expressive theme in one brightness: what every component reads
through context.expressiveTheme, as Material's components read
ThemeData.
Build one with preset or a preset's own factory
(ExpressiveThemeData.baseline, ExpressiveThemeData.slate, ...), or
an app's with forApp; mount it with ExpressiveTheme, the one root
widget, in any app's builder::
WidgetsApp(
color: const Color(0xFF6750A4),
builder: (context, child) => ExpressiveTheme(
data: ExpressiveThemeData.preset(
'baseline',
MediaQuery.platformBrightnessOf(context),
),
child: child!,
),
)
- Mixed-in types
- Annotations
Constructors
- ExpressiveThemeData({required String id, required Brightness brightness, required ExpressiveExpression expression, required ExpressiveColorScheme colors, required ExpressiveTextTheme type, required ExpressiveShapes shapes, required ExpressiveMotion motion, ExpressiveComponentThemeData buttonTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData iconButtonTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData segmentedButtonTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData chipTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData listTileTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData appBarTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData snackBarTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData dialogTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData textFieldTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData cardTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData floatingActionButtonTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData splitButtonTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData checkboxTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData radioTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData switchTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData sliderTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData numberFieldTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData inputOtpTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData selectTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData searchTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData tooltipTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData popoverTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData bottomSheetTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData datePickerTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData timePickerTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData badgeTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData avatarTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData optionTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData messageBubbleTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData bannerTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData toolbarTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData tabTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData tabBarTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData ratingTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData tableTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData chartTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData pageDotsTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData carouselTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData stepProgressTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData meterTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData progressIndicatorTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData imageTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData skeletonTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData statusViewTheme = const ExpressiveComponentThemeData(), ExpressiveComponentThemeData loadingIndicatorTheme = const ExpressiveComponentThemeData(), ExpressiveDensity? density, ExpressiveStatusColors? status})
-
A theme from its parts. Prefer preset or forApp: a theme's colours
are baked from its record, never typed.
const
- ExpressiveThemeData.baseline([Brightness brightness = Brightness.light])
-
baseline: Compose's own default scheme, whatMaterialExpressiveThemepaints unthemed (seed #6750A4, tonal spot, Expressive motion, balanced). The default preset.factory - ExpressiveThemeData.bloom([Brightness brightness = Brightness.light])
-
bloom: an orchid rose seed (#B5487A), vibrant, Expressive motion, bold.factory - ExpressiveThemeData.ember([Brightness brightness = Brightness.light])
-
ember: a burnt orange seed (#C25A1F), the hue-rotating expressive variant, Expressive motion, bold.factory - ExpressiveThemeData.from({required Color seed, Brightness brightness = Brightness.light, double contrastLevel = 0})
-
Derives a palette from an app's seed using Material's tonal colour
algorithm (
ColorScheme.fromSeed), atcontrastLevel, Material's own: 0 standard (the default, asfromSeed's) or 1 high.ExpressiveHostwears the high-contrast theme an app hands it when the platform asks for high contrast (MediaQuery.highContrastOf).factory - ExpressiveThemeData.fromBaked(ExpressiveThemeSpec spec, Brightness brightness)
-
spec, an app's baked theme, inbrightness. Throws an ArgumentError for a recordtheme.jsonwould refuse, and a StateError unless its colours carry exactly the ExpressiveColorRoles.factory - ExpressiveThemeData.grove([Brightness brightness = Brightness.light])
-
grove: a forest green seed (#2E7D5B), tonal spot, Expressive motion, balanced.factory - ExpressiveThemeData.slate([Brightness brightness = Brightness.light])
-
slate: a blue-grey seed (#52667A), neutral, Standard motion, calm.factory
Properties
- appBarTheme → ExpressiveComponentThemeData
-
The app bar's.
final
- avatarTheme → ExpressiveComponentThemeData
-
Visual slots for the avatar component.
final
- badgeTheme → ExpressiveComponentThemeData
-
Visual slots for the badge component.
final
-
Visual slots for the banner component.
final
- bottomSheetTheme → ExpressiveComponentThemeData
-
Visual slots for the bottomSheet component.
final
- brightness → Brightness
-
Light or dark. Dark is generated, never an inversion of light.
final
-
The button's.
final
- cardTheme → ExpressiveComponentThemeData
-
Visual slots for the card component.
final
- carouselTheme → ExpressiveComponentThemeData
-
Visual slots for the carousel family.
final
- chartTheme → ExpressiveComponentThemeData
-
Visual slots for chart frames and content.
final
- checkboxTheme → ExpressiveComponentThemeData
-
Visual slots for the checkbox component.
final
- chipTheme → ExpressiveComponentThemeData
-
A chip's.
final
- colors → ExpressiveColorScheme
-
The colour roles (
color.dart).final - datePickerTheme → ExpressiveComponentThemeData
-
Visual slots for the datePicker component.
final
- density → ExpressiveDensity
-
Density, in Flutter's steps (ExpressiveDensity.standard,
comfortable,compact): unset, it adapts to the platform (ExpressiveDensity.adaptivePlatformDensity), compact where a pointer is the norm (macOS, Windows, Linux) and standard on touch. Touch targets keep their accessible minimum at every density.no setter - dialogTheme → ExpressiveComponentThemeData
-
The alert dialog's.
final
- elevation → ExpressiveElevation
-
Tonal and shadow elevation in this theme's colours (
elevation.dart).no setter - expression → ExpressiveExpression
-
The theme's expression budget.
final
- floatingActionButtonTheme → ExpressiveComponentThemeData
-
Visual slots for the fab component.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- iconButtonTheme → ExpressiveComponentThemeData
-
The icon button's.
final
- id → String
-
The theme's id: its
themes/<id>/directory and preset name.final - imageTheme → ExpressiveComponentThemeData
-
Visual slots for the image family.
final
- inputOtpTheme → ExpressiveComponentThemeData
-
Visual slots for the codeField component.
final
- listTileTheme → ExpressiveComponentThemeData
-
A list row's.
final
- loadingIndicatorTheme → ExpressiveComponentThemeData
-
Visual slots for the loadingIndicator family.
final
-
A menu's.
final
- messageBubbleTheme → ExpressiveComponentThemeData
-
Visual slots for the messageBubble component.
final
- meterTheme → ExpressiveComponentThemeData
-
Visual slots for the meter family.
final
- motion → ExpressiveMotion
-
The motion scheme and its springs (
motion.dart). A component reads its springs where it runs, withExpressiveMotion.of(context), which adds a Standard-pinned subtree and Reduce Motion to this scheme.final -
Visual slots for the navigationBar component.
final
-
Visual slots for the navigationItem component.
final
-
Visual slots for the navigationRail component.
final
- numberFieldTheme → ExpressiveComponentThemeData
-
Visual slots for the quantityStepper component.
final
- optionTheme → ExpressiveComponentThemeData
-
Visual slots for the option component.
final
- pageDotsTheme → ExpressiveComponentThemeData
-
Visual slots for the pageDots family.
final
- popoverTheme → ExpressiveComponentThemeData
-
Visual slots for the popover component.
final
- progressIndicatorTheme → ExpressiveComponentThemeData
-
Visual slots for the progressIndicator family.
final
- radioTheme → ExpressiveComponentThemeData
-
Visual slots for the radio component.
final
- ratingTheme → ExpressiveComponentThemeData
-
Visual slots for the rating component.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchTheme → ExpressiveComponentThemeData
-
Visual slots for the search component.
final
- segmentedButtonTheme → ExpressiveComponentThemeData
-
A segment's.
final
- selectTheme → ExpressiveComponentThemeData
-
Visual slots for the select component.
final
- shapes → ExpressiveShapes
-
The shape scale (M3's
extraSmalltoextraExtraLargeandfull), shared by every part's surface and every token-painted corner: the one way to an app's corners. A component theme sets one part's shape.final - skeletonTheme → ExpressiveComponentThemeData
-
Visual slots for the skeleton family.
final
- sliderTheme → ExpressiveComponentThemeData
-
Visual slots for the slider component.
final
- snackBarTheme → ExpressiveComponentThemeData
-
The snackbar's.
final
- splitButtonTheme → ExpressiveComponentThemeData
-
Visual slots for the splitButton component.
final
- states → ExpressiveStateLayers
-
The state-layer opacities (
states.dart): Compose'sStateTokens, the same in every theme.no setter - status → ExpressiveStatusColors
-
The status tones (ExpressiveStatusColors): the baked theme's, or the
default preset's in this brightness for a theme built without them.
no setter
- statusViewTheme → ExpressiveComponentThemeData
-
Visual slots for the screenState family.
final
- stepProgressTheme → ExpressiveComponentThemeData
-
Visual slots for the stepProgress family.
final
- switchTheme → ExpressiveComponentThemeData
-
Visual slots for the switchControl component.
final
- tabBarTheme → ExpressiveComponentThemeData
-
Visual slots for the tabBar component.
final
- tableTheme → ExpressiveComponentThemeData
-
Visual slots for the table component.
final
- tabTheme → ExpressiveComponentThemeData
-
Visual slots for the tab component.
final
- textFieldTheme → ExpressiveComponentThemeData
-
A text field's.
final
- timePickerTheme → ExpressiveComponentThemeData
-
Visual slots for the timePicker component.
final
- toolbarTheme → ExpressiveComponentThemeData
-
Visual slots for the toolbar component.
final
- tooltipTheme → ExpressiveComponentThemeData
-
Visual slots for the tooltip component.
final
- type → ExpressiveTextTheme
-
The type scale (
type.dart).final
Methods
-
copyWith(
{ExpressiveExpression? expression, ExpressiveColorScheme? colors, ExpressiveTextTheme? type, ExpressiveShapes? shapes, ExpressiveDensity? density, ExpressiveMotion? motion, ExpressiveStatusColors? status, ExpressiveComponentThemeData? buttonTheme, ExpressiveComponentThemeData? iconButtonTheme, ExpressiveComponentThemeData? segmentedButtonTheme, ExpressiveComponentThemeData? chipTheme, ExpressiveComponentThemeData? listTileTheme, ExpressiveComponentThemeData? appBarTheme, ExpressiveComponentThemeData? snackBarTheme, ExpressiveComponentThemeData? dialogTheme, ExpressiveComponentThemeData? textFieldTheme, ExpressiveComponentThemeData? cardTheme, ExpressiveComponentThemeData? floatingActionButtonTheme, ExpressiveComponentThemeData? splitButtonTheme, ExpressiveComponentThemeData? checkboxTheme, ExpressiveComponentThemeData? radioTheme, ExpressiveComponentThemeData? switchTheme, ExpressiveComponentThemeData? sliderTheme, ExpressiveComponentThemeData? numberFieldTheme, ExpressiveComponentThemeData? inputOtpTheme, ExpressiveComponentThemeData? selectTheme, ExpressiveComponentThemeData? searchTheme, ExpressiveComponentThemeData? tooltipTheme, ExpressiveComponentThemeData? popoverTheme, ExpressiveComponentThemeData? bottomSheetTheme, ExpressiveComponentThemeData? datePickerTheme, ExpressiveComponentThemeData? timePickerTheme, ExpressiveComponentThemeData? badgeTheme, ExpressiveComponentThemeData? avatarTheme, ExpressiveComponentThemeData? optionTheme, ExpressiveComponentThemeData? messageBubbleTheme, ExpressiveComponentThemeData? bannerTheme, ExpressiveComponentThemeData? toolbarTheme, ExpressiveComponentThemeData? tabTheme, ExpressiveComponentThemeData? tabBarTheme, ExpressiveComponentThemeData? ratingTheme, ExpressiveComponentThemeData? loadingIndicatorTheme, ExpressiveComponentThemeData? statusViewTheme, ExpressiveComponentThemeData? skeletonTheme, ExpressiveComponentThemeData? imageTheme, ExpressiveComponentThemeData? progressIndicatorTheme, ExpressiveComponentThemeData? meterTheme, ExpressiveComponentThemeData? stepProgressTheme, ExpressiveComponentThemeData? chartTheme, ExpressiveComponentThemeData? pageDotsTheme, ExpressiveComponentThemeData? carouselTheme, ExpressiveComponentThemeData? tableTheme}) → ExpressiveThemeData -
This theme with the parts given replaced: an app's own override of
one foundation, or a subtree's (mount it on an ExpressiveTheme). A
named component theme (
chipTheme:) replaces that one. -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
- defaultPreset → String
-
The preset used when a host has no explicit theme.
no setter
-
presets
→ List<
String> -
Available preset IDs, starting with the default.
no setter
Static Methods
-
forApp(
String id, List< ExpressiveThemeSpec> appThemes, Brightness brightness) → ExpressiveThemeData -
The theme
idinbrightnessfor an app whose own baked themes areappThemes: the app theme of that id, else the system preset. Throws an ArgumentError for an id neither has, and when two app themes share an id. -
lerp(
ExpressiveThemeData a, ExpressiveThemeData b, double t) → ExpressiveThemeData -
aandbinterpolated att(0 isa, 1 isb), asThemeData.lerpis: every colour role through ExpressiveColorScheme.lerp, the status tones colour by colour, the component themes slot by slot (ExpressiveComponentThemeData.lerp), and the parts that do not interpolate (the id, the brightness, the expression budget, the type scale, the shape scale and the motion scheme) taken fromabelow one half and frombfrom it.tmay overshoot, as a spring does. -
of(
BuildContext context) → ExpressiveThemeData -
The theme in force at
context: the nearest ExpressiveTheme's, else the default preset in the platform's brightness. The same ascontext.expressiveThemeand ExpressiveTheme.of. -
preset(
String id, Brightness brightness, {double contrastLevel = 0}) → ExpressiveThemeData -
The theme
idinbrightness, from the generated baked themes, atcontrastLevel: 0 standard (the default) or 1 high.baseline, Compose's own fixed scheme, takes its high level from its seed (#6750A4) as ExpressiveThemeData.from does. Any other level fails an assert in a debug build and takes the nearer of the two in a release build: at Material's medium level a light container falls to a mid tone, where a dragged row's state layer takes its words under 4.5:1 (see ExpressiveThemeData.from). Throws an ArgumentError for an id no theme has.