innerAnimateTo method
Future
innerAnimateTo({
- required int index,
- required Duration duration,
- required Curve curve,
- EdgeInsets padding = EdgeInsets.zero,
- BuildContext? sliverContext,
- bool isFixedHeight = false,
- double alignment = 0,
- ObserverLocateIndexOffsetCallback? offset,
- ObserverRenderSliverType? renderSliverType,
inherited
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 and the
renderSliverType
parameter.
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 innerAnimateTo({
required int index,
required Duration duration,
required Curve curve,
EdgeInsets padding = EdgeInsets.zero,
BuildContext? sliverContext,
bool isFixedHeight = false,
double alignment = 0,
ObserverLocateIndexOffsetCallback? offset,
ObserverRenderSliverType? renderSliverType,
}) {
Completer completer = Completer();
_scrollToIndex(
completer: completer,
index: index,
isFixedHeight: isFixedHeight,
alignment: alignment,
padding: padding,
sliverContext: sliverContext,
duration: duration,
curve: curve,
offset: offset,
renderSliverType: renderSliverType,
);
return completer.future;
}