scrollToIndex method

Future<bool> scrollToIndex(
  1. int index, {
  2. Duration duration = const Duration(milliseconds: 250),
  3. Curve curve = Curves.linearToEaseOut,
  4. double alignment = 0,
  5. double offset = 0,
})

Scrolls to a specific index in the item list.

Implementation

Future<bool> scrollToIndex(
  int index, {
  Duration duration = const Duration(milliseconds: 250),
  Curve curve = Curves.linearToEaseOut,
  double alignment = 0,
  double offset = 0,
}) {
  if (_scrollToIndex == null) {
    return Future.value(false);
  }

  return (_scrollToIndex as PaginationScrollToIndex)(
    index,
    duration: duration,
    curve: curve,
    alignment: alignment,
    offset: offset,
  );
}