frictionFactor method

double frictionFactor(
  1. double overscrollFraction
)

The multiple applied to overscroll to make it appear that scrolling past the edge of the scrollable contents is harder than scrolling the list. This is done by reducing the ratio of the scroll effect output vs the scroll gesture input.

This factor starts at 0.52 and progressively becomes harder to overscroll as more of the area past the edge is dragged in (represented by an increasing overscrollFraction which starts at 0 when there is no overscroll).

Implementation

double frictionFactor(double overscrollFraction) {
  switch (decelerationRate) {
    case ScrollDecelerationRate.fast:
      return 0.26 * math.pow(1 - overscrollFraction, 2);
    case ScrollDecelerationRate.normal:
      return 0.52 * math.pow(1 - overscrollFraction, 2);
  }
}