animateTo method

Future animateTo({
  1. required int index,
  2. required Duration duration,
  3. required Curve curve,
  4. EdgeInsets padding = EdgeInsets.zero,
  5. BuildContext? sliverContext,
  6. bool isFixedHeight = false,
  7. double alignment = 0,
  8. ObserverLocateIndexOffsetCallback? offset,
})

Jump to the specified index position with animation.

If the height of the child widget and the height of the separator are fixed, please pass the isFixedHeight parameter.

The alignment specifies the desired position for the leading edge of the child widget. It must be a value in the range 0.0, 1.0.

Implementation

Future animateTo({
  required int index,
  required Duration duration,
  required Curve curve,
  EdgeInsets padding = EdgeInsets.zero,
  BuildContext? sliverContext,
  bool isFixedHeight = false,
  double alignment = 0,
  ObserverLocateIndexOffsetCallback? offset,
}) {
  return innerAnimateTo(
    index: index,
    duration: duration,
    curve: curve,
    padding: padding,
    sliverContext: sliverContext,
    isFixedHeight: isFixedHeight,
    alignment: alignment,
    offset: offset,
    renderSliverType: ObserverRenderSliverType.list,
  );
}