precedingScrollExtent property

double precedingScrollExtent

The scroll distance that has been consumed by all Slivers that came before this Sliver.

Edge Cases

Slivers often lazily create their internal content as layout occurs, e.g., SliverList. In this case, when Slivers exceed the viewport, their children are built lazily, and the Sliver does not have enough information to estimate its total extent, precedingScrollExtent will be double.infinity for all Slivers that appear after the lazily constructed child. This is because a total scrollExtent cannot be calculated unless all inner children have been created and sized, or the number of children and estimated extents are provided. The infinite scrollExtent will become finite as soon as enough information is available to estimate the overall extent of all children within the given Sliver.

Slivers may legitimately be infinite, meaning that they can scroll content forever without reaching the end. For any Slivers that appear after the infinite Sliver, the precedingScrollExtent will be double.infinity.


final double precedingScrollExtent