ComponentElement class abstract

An Element that composes other widgets but does not create a render object.

Analogous to Flutter's ComponentElement. Subclasses must implement build.

Inheritance
Implemented types
Implementers
Available extensions

Constructors

ComponentElement(Widget widget)
Creates a ComponentElement 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 setteroverride
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.
dependOnInheritedWidgetOfExactType<T extends InheritedWidget>() → T?
Obtains the nearest InheritedWidget of type T and 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.
override
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.
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.
override
updateChild(Element? child, Widget newWidget) Element?
Updates the given child to use the given newWidget, returning the updated or newly created child element.
inherited
visitChildren(void visitor(Element e)) → void
Calls visitor for each direct child of this element.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited