BaseBoxyChild class

Base class of child handles managed by RenderBoxyMixin clients.

This should typically not be used directly, instead obtain a child handle from BoxyDelegate.getChild.

If the child was recently inflated with BaseBoxyDelegate.inflate, the associated RenderObject may not exist yet. Accessing render directly or indirectly will flush the inflation queue and bring it alive.

Inheritance
Implementers

Constructors

BaseBoxyChild({required Object id, required InflatingRenderObjectMixin<RenderObject, InflatingParentData<RenderObject>, InflatedChildHandle> parent, RenderObject? render, Element? context, Widget? widget})
Constructs a handle to children managed by RenderBoxyMixin clients.

Properties

context Element
The Element aka BuildContext representing this child.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id Object
The id of the child, will either be the id given by BoxyId, or an incrementing int.
finalinherited
isIgnored bool
Whether or not this child should be ignored by paint and BoxyChild.hitTest.
no setter
offset SliverOffset
The offset to this child relative to the parent, can be set during layout or paint with position.
getter/setter pair
parentData ↔ dynamic
A variable that can store arbitrary data by the BoxyDelegate during layout, may also be set by BoxyId.
getter/setter pair
rect Rect
The rect of this child relative to the boxy, this is only valid after BoxyChild.layout and position have been called.
no setter
render RenderObject
The RenderObject representing this child.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size SliverSize
The size of this child in the child's coordinate space, only valid after calling BoxyChild.layout.
no setter
transform Matrix4
The matrix transformation applied to this child, used by paint and hitTest.
no setter

Methods

hitTest({Matrix4? transform, Offset? offset, Offset? position, bool checkBounds = true}) bool
Hit tests this child, returns true if the hit was a success. This should only be called in BoxyDelegate.hitTest.
ignore([bool value = true]) → void
Sets whether or not this child should be ignored by paint and BoxyChild.hitTest.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint({Offset? offset, Matrix4? transform}) → void
Paints the child in the current paint context, this should only be called in BoxyDelegate.paintChildren.
position(Offset newOffset) → void
Sets the position of this child relative to the parent, this should only be called during layout or paint.
positionOnAxis(double cross, double main) → void
Sets the position of this child relative to the parent, this should only be called after BoxyChild.layout is called.
positionRect(Rect rect, [Alignment alignment = Alignment.center]) → void
Position a child inside a Rect with an Alignment, this should only be called after BoxyChild.layout.
setTransform(Matrix4 newTransform) → void
Sets the paint transform of this child, should only be called during layout or paint.
toString() String
A string representation of this object.
override

Operators

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