innerJumpTo method
- required int index,
- BuildContext? sliverContext,
- bool isFixedHeight = false,
- double alignment = 0,
- EdgeInsets padding = EdgeInsets.zero,
- ObserverLocateIndexOffsetCallback? offset,
- ObserverRenderSliverType? renderSliverType,
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 and the
renderSliverType
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 renderSliverType
parameter is used to specify the type of sliver.
If you do not pass the renderSliverType
parameter, the sliding position
will be calculated based on the actual type of obj, and there may be
deviations in the calculation of elements for third-party libraries.
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 innerJumpTo({
required int index,
BuildContext? sliverContext,
bool isFixedHeight = false,
double alignment = 0,
EdgeInsets padding = EdgeInsets.zero,
ObserverLocateIndexOffsetCallback? offset,
ObserverRenderSliverType? renderSliverType,
}) {
Completer completer = Completer();
_scrollToIndex(
completer: completer,
index: index,
isFixedHeight: isFixedHeight,
alignment: alignment,
padding: padding,
sliverContext: sliverContext,
offset: offset,
renderSliverType: renderSliverType,
);
return completer.future;
}