M3ETheme class
Provides an M3EThemeData to the widget subtree.
At the app entry point, pass initialTheme, autoTheming, dynamicColoring, and an optional controller to enable adaptive theming. Nested instances that only pass data continue to provide a static local override.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- M3ETheme
Constructors
- M3ETheme({required M3EThemeData data, required Widget child, Brightness? initialTheme, bool? autoTheming, bool? dynamicColoring, M3EThemeController? controller, Key? key})
-
Creates an expressive theme provider for
child.const
Properties
- autoTheming → bool?
-
When true, follows platform brightness (with optional invert via
controller).
final
- child → Widget
-
The subtree under this theme.
final
- controller → M3EThemeController?
-
Optional controller for manual brightness overrides.
final
- data → M3EThemeData
-
Theme tokens and component themes for this subtree.
final
- dynamicColoring → bool?
-
When true, applies device dynamic color to the active scheme.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialTheme → Brightness?
-
Initial brightness when adaptive theming is enabled.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- usesAdaptiveScope → bool
-
Whether this instance should host an adaptive M3EThemeScope.
no setter
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< M3ETheme> -
Creates the mutable state for this widget.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
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
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
brightnessOf(
BuildContext context) → Brightness - Brightness from the nearest M3ETheme, else platform brightness.
-
controllerOf(
BuildContext context) → M3EThemeController? - Returns the nearest adaptive M3EThemeController, if any.
-
maybeOf(
BuildContext context) → M3EThemeData? - Returns the nearest expressive theme, or null if none is found.
-
of(
BuildContext context) → M3EThemeData - Returns the nearest expressive theme, or derives one from Material.
-
platformOf(
BuildContext context) → TargetPlatform - Platform from the nearest M3ETheme, else Theme or default.