MultiChildRenderObjectElement class
Element for RenderObjectWidgets with multiple children.
Adopts each child's render object onto the parent render object via the standard RenderObject.adoptChild / RenderObject.dropChild pair. Subclasses can override adoptChildRenderObject / dropChildRenderObject to plug into more specialised parents (e.g. RenderFlex needs flex metadata; see FlexRenderObjectElement).
- Inheritance
-
- Object
- Element
- RenderObjectElement
- MultiChildRenderObjectElement
- Implementers
Constructors
- MultiChildRenderObjectElement(MultiChildRenderObjectWidget widget)
- Creates an element for a MultiChildRenderObjectWidget.
Properties
- buildContext → BuildContext
-
The BuildContext for this element.
no setterinherited
-
children
→ List<
Element> -
The child elements of this element.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- mounted ↔ bool
-
Whether this element is currently in the tree.
getter/setter pairinherited
- owner ↔ BuildOwner
-
The owner that manages this element's build pipeline.
latefinalinherited
- parent ↔ Element?
-
The parent element, or null for the root.
getter/setter pairinherited
- renderObject → RenderObject?
-
Get the RenderObject managed by this element
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widget ↔ MultiChildRenderObjectWidget
-
The widget this element currently represents.
getter/setter pairinherited-setteroverride-getter
Methods
-
adoptChildRenderObject(
RenderBox child, Element childElement, int slot) → void -
Adopt
childonto this element's render object atslot(document order). Subclasses override to attach extra metadata such as flex factors. -
attachRenderObject(
) → void -
Attach the RenderObject to its parent in the render tree
inherited
-
debugDescribeWidget(
) → String -
Short debug description of this element's widget and key.
inherited
-
dependOnInheritedElementOfExactType<
T extends InheritedWidget> ({Object? aspect}) → InheritedElement? -
Registers this element as dependent on the nearest inherited widget of type
T.inherited -
detachRenderObject(
) → void -
Detach the RenderObject from its parent in the render tree
inherited
-
didLoseDependency(
InheritedElement inherited) → void -
Called when
inheritedremoves this element from its dependents.inherited -
dropChildRenderObject(
RenderObject child, Element? childElement) → void -
Drop
childfrom this element's render object.childElementis null when the drop happens as part of a re-sync pass rather than an element removal. -
findAncestorRenderObjectOfExactType<
T extends RenderObject> () → T? -
Returns the nearest ancestor render object of type
T.inherited -
findAncestorStateOfType<
T extends State< (StatefulWidget> >) → T? -
Returns the nearest ancestor state of type
T.inherited -
findAncestorWidgetOfExactType<
T extends Widget> () → T? -
Returns the nearest ancestor widget of type
T.inherited -
findRenderObject(
) → RenderObject? -
Find the RenderObject managed by this element
inherited
-
getElementForInheritedWidgetOfExactType<
T extends InheritedWidget> () → InheritedElement? -
Returns the nearest inherited element of type
Twithout registering a dependency.inherited -
insertRenderObjectChild(
RenderObject child, Element childElement) → void -
Hook for parents to place newly attached render object children.
override
-
mount(
Element? parent, BuildOwner owner) → void -
Inserts this element into the tree under
parentand builds it.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyDependent(
InheritedElement inherited, Object? aspect) → void -
Called by
inheritedwhen it changes; schedules this element to rebuild.inherited -
performRebuild(
) → void -
Rebuilds this element's subtree from its current widget configuration.
inherited
-
rebuild(
) → void -
Rebuilds this element, refreshing its inherited-widget dependencies.
inherited
-
removeRenderObjectChild(
RenderObject child, Element childElement) → void -
Hook for parents to remove render object children on detach.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unmount(
) → void -
Removes this element and its descendants from the tree permanently.
override
-
update(
Widget newWidget) → void -
Updates this element to represent
newWidgetand rebuilds it.override -
visitAncestorElements(
bool visitor(Element element)) → void -
Walk up the element tree calling
visitorfor each ancestor until it returnsfalseor the root is reached.inherited -
visitChildren(
ElementVisitor visitor) → void -
Calls
visitorfor each child element of this element.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited