sliver_tree/_ghost_registry library

Edge-ghost lifecycle registry — install, re-evaluate under scroll, re-promote when the true structural row re-enters the viewport, prune on settle, and resolve a ghost's painted base Y on demand.

Edge ghosts are rows whose new structural position is off-screen when a slide animation begins. Instead of painting them at their invisible structural Y, the render layer anchors them to the viewport edge they're nearest to and slides them in / out from there. The actual painted Y is derived live from the current viewport via GhostBaseResolver.baseFor, so the ghost stays pinned to the live edge under concurrent scrolling.

This file also defines the GhostBaseResolver interface — the narrow paint-time read contract that RenderSliverTree holds.

Classes

GhostBaseResolver<TKey>
Paint-time read contract for edge ghosts. Held by RenderSliverTree in applyPaintTransform, childMainAxisPosition, paint, and the hit-test admission path. Same idiom as Plan A's AnimationReader — a narrow abstract interface lets paint-side tests stub it without constructing a full ghost registry.
GhostRegistry<TKey, TData>

Typedefs

GhostEntry = ({Curve curve, Duration duration, ViewportEdge edge})
Active-edge-ghost entry shape. Mirrors the record formerly stored inline in _phantomEdgeExits. Promoted to a named record so the registry's lifecycle methods can refer to it without re-spelling the tuple at every signature.