scrollTo method

  1. @override
Future<void> scrollTo({
  1. required int index,
  2. required Duration duration,
  3. double alignment = 0,
  4. bool automaticAlignment = true,
  5. Curve curve = Curves.linear,
  6. List<double> opacityAnimationWeights = const [40, 20, 40],
})

Scrolls to the element at index. The element will be placed under the group header. To set a custom alignment set automaticAlignment to false.

See ItemScrollController.scrollTo

Implementation

@override
Future<void> scrollTo({
  required int index,
  required Duration duration,
  double alignment = 0,
  bool automaticAlignment = true,
  Curve curve = Curves.linear,
  List<double> opacityAnimationWeights = const [40, 20, 40],
}) {
  if (automaticAlignment) {
    alignment = _stickyGroupedListViewState!.headerDimension ?? alignment;
  }
  return super.scrollTo(
    index: index * 2 + 1,
    alignment: alignment,
    duration: duration,
    curve: curve,
    opacityAnimationWeights: opacityAnimationWeights,
  );
}