SliverBoxyDelegate<LayoutData extends Object> class
abstract
A delegate that controls the layout and paint of child widgets, used by CustomBoxy.
This is similar to BoxyDelegate, but uses the RenderSliver protocol and supports both BoxyChild and SliverBoxyChild children.
See also:
- CustomBoxy, the widget of a boxy.
- BoxyChild, a child handle for RenderBox.
- SliverBoxyChild, a child handle for RenderSliver.
- BoxyLayerContext, a wrapper that can push Layers.
- Inheritance
-
- Object
- BaseBoxyDelegate<
LayoutData, BaseBoxyChild> - SliverBoxyDelegate
Constructors
- SliverBoxyDelegate({Listenable? relayout, Listenable? repaint})
-
Constructs a BoxyDelegate with optional
relayoutandrepaintListenables.
Properties
- buildContext → BuildContext
-
Gets the BuildContext of this boxy.
no setterinherited
- canvas → Canvas
-
The current canvas, should only be accessed from paint methods.
no setterinherited
-
children
→ List<
BaseBoxyChild> -
A list of each BoxyChild handle associated with the boxy, the list
itself should not be modified by the delegate.
no setterinherited
-
childrenForSemantics
→ Iterable<
BaseBoxyChild> -
An iterable of children to be visited for semantics, in paint order,
skipping children that are not semantically relevant.
no setterinherited
- constraints → SliverConstraints
-
The most recent constraints given to this boxy by its parent.
no setteroverride
- debugPhase → BoxyDelegatePhase
-
The current phase in the render pipeline that this boxy is performing,
only valid in debug mode.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitTestResult → HitTestResult
-
The current hit test result, should only be accessed from hitTest.
no setterinherited
- 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 setterinherited
- layers → BoxyLayerContext
-
The current layer context, useful for pushing Layers to the scene during
paintChildren.
no setterinherited
- layoutData ↔ LayoutData?
-
A variable to hold additional data created during layout which can be
used while painting and hit testing.
getter/setter pairinherited
- needsCompositing → bool
-
Override this method to return true if the paint method will push one or
more layers to paintingContext.
no setterinherited
- paintingContext → PaintingContext
-
The current painting context, should only be accessed from paint methods.
no setterinherited
- paintOffset → Offset
-
The offset of the current paint context.
no setterinherited
-
render
→ RenderSliverBoxy<
BaseBoxyChild> -
The RenderBoxyMixin of the current context.
no setteroverride
- renderSize → SliverSize
-
The last size returned by layout.
no setteroverride
- 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.
override
-
getChild<
T extends ChildHandleType> (Object id) → T -
Gets the child handle with the specified
id.inherited -
getChildOrNull<
T extends ChildHandleType> (Object id) → T? -
Gets the child handle with the specified
idor returns null if there is no child with givenid.inherited -
hasChild(
Object id) → bool -
Returns true if a child exists with the specified
id.inherited -
hitTest(
SliverOffset position) → bool -
Override this method to change how the boxy gets hit tested.
inherited
-
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.
inherited
-
layout(
) → SliverGeometry - Override this method to lay out children and return the final geometry of the boxy.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPointerEvent(
PointerEvent event, covariant SliverHitTestEntry entry) → void -
Override to handle pointer events that hit this boxy.
override
-
paint(
) → void -
Override this method to paint below children.
inherited
-
paintChildren(
) → void -
Override this method to change how children get painted.
inherited
-
paintForeground(
) → void -
Override this method to paint above children.
inherited
-
paintLayer(
ContainerLayer layer, {VoidCallback? painter, Offset? offset, Rect? debugBounds}) → void -
Paints a ContainerLayer compositing layer in the current painting
context with an optional
paintercallback, this should only be called in paintChildren.inherited -
shouldRelayout(
covariant BaseBoxyDelegate< Object, BaseBoxyChild> oldDelegate) → bool -
Override this method to return true when the children need to be
laid out.
inherited
-
shouldRepaint(
covariant BaseBoxyDelegate< Object, BaseBoxyChild> oldDelegate) → bool -
Override this method to return true when the children need to be
repainted.
inherited
-
toString(
) → String -
Override this method to include additional information in the
debugging data printed by debugDumpRenderTree and friends.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited