jumpToPage method

dynamic jumpToPage(
  1. int page
)

Directly Jump to the mentioned page without any animation

Implementation

jumpToPage(int page) {
  if (page == activePageIndex || isInProgress) return;
  if (page > pagesLength - 1 || page < 0) {
    throw ("Index $page not found in the Pages list");
  }
  isInProgress = true;
  activePageIndex = page - 1;
  nextPageIndex = page;
  if (nextPageIndex >= pagesLength) nextPageIndex = 0;
  updateSlide(SlideUpdate(SlideDirection.rightToLeft, 1, positionSlideIcon,
      UpdateType.doneAnimating));
  isInProgress = false;
}