RenderObjectWithSingleChild mixin

Mixin for render objects that own a single render child.

Codifies the RenderProxyBox.child= idempotent setter pattern as the single ownership boundary for single-child render objects. Re-assigning the same child or one already adopted via adoptChild must be safe (no double adoption).

Superclass constraints
Mixin applications

Properties

children List<RenderObject>
Child RenderObjects
finalinherited
debugNeedsLayout bool
Whether this render object is waiting for layout.
no setterinherited
debugNeedsPaint bool
Whether this render object is waiting for paint.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
height int
Height in terminal cells, assigned during layout.
getter/setter pairinherited
parent RenderObject?
Parent RenderObject in the tree
getter/setter pairinherited
pipelineOwner → PipelineOwner?
The pipeline owner this render object is attached to, if any.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
Width in terminal cells, assigned during layout.
getter/setter pairinherited
x int
Horizontal position in terminal cells, relative to the parent.
getter/setter pairinherited
y int
Vertical position in terminal cells, relative to the parent.
getter/setter pairinherited

Methods

adoptChild(RenderObject child) → void
Add a child to this render object
inherited
attach(PipelineOwner owner) → void
Attach this render object and its existing children to owner.
inherited
detach() → void
Called when the render object is detached from the render tree.
inherited
dropChild(RenderObject child) → void
Remove a child from this render object
inherited
hitTest(HitTestResult result, Offset position) bool
Hit-test this render object using position in local coordinates.
inherited
layout(Constraints constraints) → void
Entry point for layout.
inherited
markNeedsLayout() → void
Mark this render object as needing layout and paint.
inherited
markNeedsPaint() → void
Mark this render object as needing paint.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(PaintingContext context, Offset offset) → void
Paint protocol: record drawing commands at offset.
inherited
performLayout(Constraints constraints) → void
Layout protocol: given constraints, compute size and position.
inherited
setChild(RenderObject? child) → void
Replace this object's single render child.
toString() String
A string representation of this object.
inherited
updateChild(RenderObject? current, RenderObject? next) RenderObject?
Drop current and adopt next, returning next as the new child.
visitChildren(void visitor(RenderObject child)) → void
Visit all children with a callback
inherited

Operators

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