sliver_tree/_drag_session library

Internal: per-drag session infrastructure for TreeReorderController: SessionExit, PointerSample and PointerSpace, DragProbe, and DragSession itself. The behavior collaborators the session fans out to live in _drag_session_behaviors.dart.

PointerSpace is the ONLY component that touches the scrollable: every coordinate conversion, every liveness question and the scroll subscription go through it, and its reads are NULLABLE. A null sample means the scrollable's State is unmounted, at which point even reading .context throws, so the nullability forces every consumer to handle the defunct case at the type level.

Class names are public despite the underscore-prefixed file: Dart makes an underscore-prefixed CLASS name library-private, which would hide it from the headless unit tests. Internality comes from barrel non-export instead, as with DropZoneResolver and ReorderPreviewEngine.

Classes

DragProbe<TKey>
The session's resolution core: the ONE owner of grab geometry and the ONE site that turns a PointerSample into a TreeDropTarget. Both the per-event pipeline (DragSession.resolve) and endDrag's commit re-resolution go through resolveTarget, so the committed slot is always the slot the feedback showed.
DragSession<TKey>
Per-drag state held only while a drag is active. It owns the two consolidation sites: resolve (the ONE choreography site) and detachAll (the ONE teardown site, dispatched on SessionExit). Behaviors are reached by direct calls, with no interface and no registration list. Notification channels stay with the controller: this class never notifies listeners.
PointerSpace<TKey>
Coordinate conversion + liveness for one drag session. See library docs for the nullable-read contract.

Enums

SessionExit
How a drag session ended. Collaborator teardown dispatches on this: e.g. the make-room gap releases ANIMATED on cancel (rows glide home), SNAPS on dispose (nothing left to animate against), and does nothing on commit (the commit script already snapped it before the mutation).

Typedefs

PointerSample = ({double sliverX, double sliverY, double viewportDy, double viewportHeight})
One pointer conversion: everything the drag pipeline derives from a pointer position, computed from a SINGLE viewport lookup per event.