precedingScrollExtent property Null safety

double precedingScrollExtent
final

The scroll distance that has been consumed by all RenderSlivers that came before this RenderSliver.

Edge Cases

RenderSlivers often lazily create their internal content as layout occurs, e.g., SliverList. In this case, when RenderSlivers exceed the viewport, their children are built lazily, and the RenderSliver does not have enough information to estimate its total extent, precedingScrollExtent will be double.infinity for all RenderSlivers that appear after the lazily constructed child. This is because a total SliverGeometry.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 SliverGeometry.scrollExtent will become finite as soon as enough information is available to estimate the overall extent of all children within the given RenderSliver.

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

Implementation

final double precedingScrollExtent;