userScrollDirection property

ScrollDirection userScrollDirection

The direction in which the user is attempting to scroll, relative to the axisDirection and growthDirection.

For example, if growthDirection is GrowthDirection.reverse and axisDirection is AxisDirection.down, then a ScrollDirection.forward means that the user is scrolling up, in the positive scrollOffset direction.

If the user is not scrolling, this will return ScrollDirection.idle even if there is (for example) a ScrollActivity currently animating the position.

This is used by some slivers to determine how to react to a change in scroll offset. For example, RenderSliverFloatingPersistentHeader will only expand a floating app bar when the userScrollDirection is in the positive scroll offset direction.


final ScrollDirection userScrollDirection