PointerSpace<TKey> class
Coordinate conversion + liveness for one drag session. See library docs for the nullable-read contract.
Constructors
-
PointerSpace({required ScrollableState scrollable, required ReorderRenderPort<
TKey> renderPort})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLive → bool
-
Whether the scrollable is still mounted. Prefer consuming the
nullability of sample/position over branching on this directly.
no setter
- position → ScrollPosition?
-
The scroll position, or
nullwhen the scrollable is unmounted.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
bindScroll(
VoidCallback listener) → void -
Subscribes
listenerto the scrollable's CURRENT position and keeps the subscription glued to it.ScrollableStateswaps itsScrollPositionwhenever the physics runtimeType changes (_shouldUpdatePosition, applied by_updatePosition, in scrollable.dart), so the identity is re-checked on every sample and on every syncScrollSubscription call; a listener left on the dead position would never fire again. unbindScroll detaches. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sample(
Offset globalPointer) → PointerSample? -
Converts
globalPointerinto every coordinate the drag pipeline needs, ornullwhen the scrollable is unmounted (or its viewport box is detached mid-teardown). -
syncScrollSubscription(
) → void - Re-points the subscription at the live position when it has been swapped. Idempotent and allocation-free: on the no-swap path it returns after one identity compare. A null live position (unmounted scrollable) detaches without re-attaching.
-
toString(
) → String -
A string representation of this object.
inherited
-
unbindScroll(
) → void - Detaches the listener installed by bindScroll, if any.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited