jumpTo method

Future jumpTo({
  1. required int index,
  2. BuildContext? sliverContext,
  3. bool isFixedHeight = false,
  4. double alignment = 0,
  5. EdgeInsets padding = EdgeInsets.zero,
  6. ObserverLocateIndexOffsetCallback? offset,
})

Jump to the specified index position without animation.

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

If you do not pass the isFixedHeight parameter, the package will automatically gradually scroll around the target location before locating, which will produce an animation.

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 jumpTo({
  required int index,
  BuildContext? sliverContext,
  bool isFixedHeight = false,
  double alignment = 0,
  EdgeInsets padding = EdgeInsets.zero,
  ObserverLocateIndexOffsetCallback? offset,
}) {
  return innerJumpTo(
    index: index,
    sliverContext: sliverContext,
    isFixedHeight: isFixedHeight,
    alignment: alignment,
    padding: padding,
    offset: offset,
    renderSliverType: ObserverRenderSliverType.list,
  );
}