jumpTo method Null safety

void jumpTo(
  1. double value
)

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.

Immediately after the jump, a ballistic activity is started, in case the value was out of range.

Implementation

void jumpTo(double value) {
  assert(_positions.isNotEmpty, 'ScrollController not attached to any scroll views.');
  for (final ScrollPosition position in List<ScrollPosition>.from(_positions))
    position.jumpTo(value);
}