- override
If scrollVelocity
is greater than PixelScrollTolerance.velocity
then
fling the scroll offset with the given velocity in logical pixels/second.
Otherwise, if this scrollable is overscrolled or a snapOffsetCallback
was given, animate the scroll offset to its final value with settleScrollOffset
.
Calling this function starts a physics-based animation of the scroll offset with the given value as the initial velocity. The physics simulation is determined by the scroll behavior.
The returned Future
completes when the scrolling animation is complete.
Source
@override Future<Null> fling(double scrollVelocity) { switch(config.itemsSnapAlignment) { case PageableListFlingBehavior.canFlingAcrossMultiplePages: return super.fling(scrollVelocity).then(_notifyPageChanged); case PageableListFlingBehavior.stopAtNextPage: return _flingToAdjacentItem(scrollVelocity); } assert(config.itemsSnapAlignment != null); return null; }