jumpTo method

  1. @override
void jumpTo (double value)
override

Jumps the scroll position from its current value to the given value, without animation, and without checking if the new value is in range.

Any active animation is canceled. If the user is currently scrolling, that action is canceled.

If this method changes the scroll position, a sequence of start/update/end scroll notifications will be dispatched. No overscroll notifications can be generated by this method.

Implementation

@override
void jumpTo(double value) {
  goIdle();
  if (pixels != value) {
    final double oldPixels = pixels;
    forcePixels(value);
    notifyListeners();
    didStartScroll();
    didUpdateScrollPositionBy(pixels - oldPixels);
    didEndScroll();
  }
  goBallistic(0.0);
}