paintedRowBounds method
Where key is painted, sliver-local. See ReorderRenderPort.
Delegates to _anchorPaintedBounds, which already substitutes the
pinned band for a sticky-pinned key and falls back to the structural
band otherwise, then converts PAINT space to sliver-local by adding
back constraints.scrollOffset. Mixing those two spaces yields an
error that is invisible while scrolled to the top, which is exactly
the shape of the bug this member exists to fix.
Call-phase note, and this is one of the two GESTURE-time callers
_anchorPaintedBounds's call-phase bullet admits (the other is
_computeA7Anchors, reached from hitTestChildren). This runs at
GESTURE time, which is neither layout nor paint, so _sticky holds
the last PAINTED frame's values. That is not a tolerated staleness:
it is precisely the geometry the user was looking at when they
pressed, which is what grab capture wants. The rule stands for
layout-time callers (_consumeSlideBaselineIfAny), where _sticky
predates this frame's recompute and would be genuinely wrong.
Implementation
@override
({double paintedOffset, double extent})? paintedRowBounds(TKey key) {
final bounds = _anchorPaintedBounds(key);
if (bounds == null) {
return null;
}
return (
paintedOffset: bounds.top + constraints.scrollOffset,
extent: bounds.height,
);
}