StatelessElement class
An Element that owns a StatelessWidget, analogous to Flutter's StatelessElement.
- Inheritance
-
- Object
- Element
- ComponentElement
- StatelessElement
- Available extensions
Constructors
- StatelessElement(StatelessWidget widget)
-
Creates a StatelessElement for the given
widget.
Properties
- dirty ↔ bool
-
Whether this element has been marked as needing to be rebuilt.
getter/setter pairinherited
- focusManager → FocusManager
-
Available on BuildContext, provided by the BuildContextNavigation extension
Returns the singleton FocusManager instance.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
-
Available on BuildContext, provided by the BuildContextNavigation extension
Returns the NavigatorState of the nearest Navigator ancestor.no setter - parent → Element?
-
The parent of this element in the tree, or null if this is the root.
no setterinherited
- renderObject → RenderObject?
-
The RenderObject associated with this element, if any.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widget ↔ Widget
-
The current configuration of this element.
getter/setter pairinherited
Methods
-
build(
) → Widget -
Builds the widget tree below this element.
override
-
dependOnInheritedWidgetOfExactType<
T extends InheritedWidget> () → T? -
Obtains the nearest InheritedWidget of type
Tand registers this element as a dependent so it rebuilds when the inherited widget changes.inherited -
findAncestorElementOfExactType<
T extends InheritedWidget> () → InheritedElement? -
Returns the nearest InheritedElement of type
T.inherited -
findAncestorWidgetOfExactType<
T extends Widget> () → T? -
Returns the nearest ancestor widget of the given type
T.inherited -
markNeedsBuild(
) → void -
Marks this element as needing to be rebuilt in the next frame.
inherited
-
mount(
Element? parent) → void -
Adds this element to the tree at the given
parent.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rebuild(
) → void -
Rebuilds the element by calling build and updating the child.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unmount(
) → void -
Removes this element from the tree and releases resources.
inherited
-
update(
Widget newWidget) → void -
Updates the widget configuration to
newWidget.inherited -
updateChild(
Element? child, Widget newWidget) → Element? -
Updates the given
childto use the givennewWidget, returning the updated or newly created child element.inherited -
visitChildren(
void visitor(Element e)) → void -
Calls
visitorfor each direct child of this element.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited