smoothScrollToIndex method

void smoothScrollToIndex(
  1. int index, {
  2. Curve curve = Curves.easeIn,
  3. Duration duration = const Duration(milliseconds: 150),
})

scroll to item index. index can be outside of items values. So it can animate multiple rotations of the wheel. Animation parameters curve and

Implementation

//  ///[duration] can be provided.
void smoothScrollToIndex(int index,
    {Curve curve = Curves.easeIn,
    Duration duration = const Duration(milliseconds: 150)}) {
  scrollController.animateTo(
    _getOffsetForSelection(index),
    curve: curve,
    duration: duration,
  );
}