scrollOffset property Null safety

double scrollOffset
final

The scroll offset, in this sliver's coordinate system, that corresponds to the earliest visible part of this sliver in the AxisDirection if growthDirection is GrowthDirection.forward or in the opposite AxisDirection direction if growthDirection is GrowthDirection.reverse.

For example, if AxisDirection is AxisDirection.down and growthDirection is GrowthDirection.forward, then scroll offset is the amount the top of the sliver has been scrolled past the top of the viewport.

This value is typically used to compute whether this sliver should still protrude into the viewport via SliverGeometry.paintExtent and SliverGeometry.layoutExtent considering how far the beginning of the sliver is above the beginning of the viewport.

For slivers whose top is not past the top of the viewport, the scrollOffset is 0 when AxisDirection is AxisDirection.down and growthDirection is GrowthDirection.forward. The set of slivers with scrollOffset 0 includes all the slivers that are below the bottom of the viewport.

SliverConstraints.remainingPaintExtent is typically used to accomplish the same goal of computing whether scrolled out slivers should still partially 'protrude in' from the bottom of the viewport.

Whether this corresponds to the beginning or the end of the sliver's contents depends on the growthDirection.

Implementation

final double scrollOffset;