scrollToItem method

void scrollToItem(
  1. int index, {
  2. bool? animate,
  3. bool center = false,
})

scrollToItem will move the scrollbar to make the item (defined by its index) visible on the screen. If the item is already fully visible in the screen, the scrollbar is not moved.

Implementation

void scrollToItem(int index, {bool? animate, bool center = false}) {
  _scrollOffItem(index, animate: animate, center: center);
}