jumpToIndex method
Jumps immediately to a specific item index given a fixed
itemExtent in pixels.
- if scroll direction is
vertical,itemExtentis the computedheightof an item in the scrollable component's children. - if scroll direction is
horizontal,itemExtentis the computedwidthof an item in the scrollable component's children.
Example
final scrollController = ScrollController();
scrollController.jumpToIndex(
5,
itemExtent: 100.0,
);
Implementation
void jumpToIndex(
int index, {
required double itemExtent,
}) {
jumpTo(index * itemExtent);
}