jumpToPage method

void jumpToPage(
  1. int page
)

Changes which page is displayed in the controlled PageView.

Jumps the page position from its current value to the given value, without animation, and without checking if the new value is in range.

Implementation

void jumpToPage(int page) {
  final ExtendedPagePosition position = this.position as ExtendedPagePosition;
  if (position._cachedPage != null) {
    position._cachedPage = page.toDouble();
    return;
  }
  position.jumpTo(position.getPixelsFromPage(page.toDouble()));
}