frictionFactor method
- double overscrollFraction
The multiple applied to overscroll to make it appear that scrolling past the edge of the scrollable contents is harder than scrolling within bounds. This is done by reducing the ratio of the scroll effect output vs the scroll gesture input.
This factor starts at 0.52 for ScrollDecelerationRate.normal and 0.26 for ScrollDecelerationRate.fast.
The overscrollFraction represents how far past the edge the user has
dragged, where 0.0 means no overscroll. As this value increases, the
friction factor decreases quadratically, making further overscroll harder.
Implementation
double frictionFactor(double overscrollFraction) {
return math.pow(1 - overscrollFraction, 2) *
switch (decelerationRate) {
ScrollDecelerationRate.fast => 0.26,
ScrollDecelerationRate.normal => 0.52,
};
}