- override
Returns a simulation that propels the scrollOffset.
This function is called when a drag gesture ends.
Returns null if the behavior is to do nothing.
Source
@override
Simulation createScrollSimulation(double position, double velocity) {
if ((isScrollable && velocity.abs() > 0) || position < minScrollOffset || position > maxScrollOffset) {
// If the triggering gesture starts at or beyond the contentExtent's limits
// then the simulation only serves to settle the scrollOffset back to its
// minimum or maximum value.
if (position < minScrollOffset || position > maxScrollOffset)
velocity = 0.0;
return super.createScrollSimulation(position, velocity);
}
return null;
}