BaseBoxyDelegate<LayoutData extends Object, ChildHandleType extends BaseBoxyChild> class
abstract
Base class for delegates that control the layout and paint of multiple children.
This class is typically not used directly, instead consider using BoxyDelegate with a CustomBoxy widget.
See also:
Constructors
- BaseBoxyDelegate({Listenable? relayout, Listenable? repaint})
-
Constructs a BaseBoxyDelegate with optional
relayout
andrepaint
Listenables.
Properties
- buildContext → BuildContext
-
Gets the BuildContext of this boxy.
no setter
- canvas → Canvas
-
The current canvas, should only be accessed from paint methods.
no setter
-
children
→ List<
ChildHandleType> -
A list of each BoxyChild handle associated with the boxy, the list
itself should not be modified by the delegate.
no setter
- constraints → Constraints
-
The most recent constraints given to this boxy by its parent.
no setter
- debugPhase → BoxyDelegatePhase
-
The current phase in the render pipeline that this boxy is performing,
only valid in debug mode.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitTestResult → HitTestResult
-
The current hit test result, should only be accessed from hitTest.
no setter
- indexedChildCount → int
-
The number of children that have not been given a BoxyId, this
guarantees there are child ids between 0 (inclusive) and indexedChildCount
(exclusive).
no setter
- layers → BoxyLayerContext
-
The current layer context, useful for pushing Layers to the scene during
paintChildren.
no setter
- layoutData ↔ LayoutData?
-
A variable to hold additional data created during layout which can be
used while painting and hit testing.
getter/setter pair
- needsCompositing → bool
-
Override this method to return true if the paint method will push one or
more layers to paintingContext.
no setter
- paintingContext → PaintingContext
-
The current painting context, should only be accessed from paint methods.
no setter
- paintOffset → Offset
-
The offset of the current paint context.
no setter
-
render
→ RenderBoxyMixin<
RenderObject, BaseBoxyParentData< RenderObject> , ChildHandleType> -
The RenderBoxyMixin of the current context.
no setter
- renderSize → Size
-
The last size returned by layout.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addHit(
) → void - Adds the boxy to hitTestResult, this should typically be called from hitTest when a hit succeeds.
-
getChild<
T extends ChildHandleType> (Object id) → T -
Gets the child handle with the specified
id
. -
getChildOrNull<
T extends ChildHandleType> (Object id) → T? -
Gets the child handle with the specified
id
or returns null if there is no child with givenid
. -
hasChild(
Object id) → bool -
Returns true if a child exists with the specified
id
. -
hitTest(
SliverOffset position) → bool - Override this method to change how the boxy gets hit tested.
-
inflate<
T extends ChildHandleType> (Widget widget, {Object? id}) → T - Dynamically inflates a widget as a child of this boxy, should only be called in BoxyChild.layout.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPointerEvent(
PointerEvent event, covariant HitTestEntry< HitTestTarget> entry) → void - Override to handle pointer events that hit this boxy.
-
paint(
) → void - Override this method to paint below children.
-
paintChildren(
) → void - Override this method to change how children get painted.
-
paintForeground(
) → void - Override this method to paint above children.
-
paintLayer(
ContainerLayer layer, {VoidCallback? painter, Offset? offset, Rect? debugBounds}) → void -
Paints a ContainerLayer compositing layer in the current painting
context with an optional
painter
callback, this should only be called in paintChildren. -
shouldRelayout(
covariant BaseBoxyDelegate< Object, BaseBoxyChild> oldDelegate) → bool - Override this method to return true when the children need to be laid out.
-
shouldRepaint(
covariant BaseBoxyDelegate< Object, BaseBoxyChild> oldDelegate) → bool - Override this method to return true when the children need to be repainted.
-
toString(
) → String -
Override this method to include additional information in the
debugging data printed by debugDumpRenderTree and friends.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited