RenderSliverTree<TKey, TData> constructor

RenderSliverTree<TKey, TData>({
  1. required TreeController<TKey, TData> controller,
  2. int maxStickyDepth = 0,
})

Creates a render sliver tree.

Implementation

RenderSliverTree({
  required TreeController<TKey, TData> controller,
  int maxStickyDepth = 0,
}) : _controller = controller,
     _maxStickyDepth = maxStickyDepth,
     _sticky = StickyHeaderComputer<TKey, TData>(
       controller: controller,
       maxStickyDepth: maxStickyDepth,
     ),
     _admission = LayoutAdmissionPolicy<TKey, TData>(controller: controller),
     _composer = SlideComposer<TKey, TData>(controller: controller) {
  // O(1) structural-offset resolver for the ghost registry: its call
  // sites run inside layout, where the per-frame offsets for
  // the relevant rows are fresh (bulk-aware via _structuralOffsetAt).
  // Controller-agnostic closure: survives controller swaps.
  //
  // Accepted staleness (2026-07-15 review): `normalizeForViewport` runs
  // early in performLayout, so the offsets it reads can be one
  // animation-tick stale versus the old prefix-summed live extents.
  // Only shifts the edge-ghost re-promotion threshold by at most 1 frame,
  // cosmetic, inherent to the O(1) design; the exact O(index) fallback
  // remains for unwired registries.
  _composer.ghosts.structuralYOf = _structuralOffsetAt;
}