jumpToIndex method
void
jumpToIndex(
- int index, {
- required ScrollPosition position,
- bool closeToEdge = true,
- double alignment = 0.0,
inherited
jump to index based on the given position.
this observer and position should be associated/attached to the same ScrollController.
if closeToEdge is true, we would try scrolling index to the edge of ScrollView.reverse if not over scrolling.
alignment only takes effects when the observed RenderObject is not visible on the screen,
if the RenderObject has been visible on the screen, alignment is ignored.
Implementation
void jumpToIndex(
int index, {
required ScrollPosition position,
bool closeToEdge = true,
double alignment = 0.0,
}) {
index = targetToRenderIndex?.call(index) ?? index;
_jumpToUnrevealedIndex(
index,
position: position,
closeToEdge: closeToEdge,
);
}