Theme class
An inherited widget that provides ThemeData to descendant widgets.
Retrieve the current theme with Theme.of.
- Inheritance
-
- Object
- Widget
- InheritedWidget
- Theme
Constructors
Properties
- child → Widget
-
The widget below this inherited widget in the tree.
finalinherited
- data → ThemeData
-
The theme data provided to descendants.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → InheritedElement -
Creates the Element for this widget.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
covariant Theme oldWidget) → bool -
Whether the widgets that depend on this widget should be rebuilt when
oldWidgetis replaced by this widget.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
maybeOf(
BuildContext context) → ThemeData -
Retrieves the nearest ThemeData, or
nullif none is found. -
of(
BuildContext context) → ThemeData - Retrieves the nearest ThemeData from the widget tree, defaulting to dark.