jumpToItem method

void jumpToItem(
  1. int itemIndex
)

Changes which item index is centered in the controlled scroll view.

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

Implementation

void jumpToItem(int itemIndex) {
  for (final _FixedExtentScrollPosition position in positions.cast<_FixedExtentScrollPosition>()) {
    position.jumpTo(itemIndex * position.itemExtent);
  }
}