updateCurrentPageIndex method

void updateCurrentPageIndex(
  1. int index
)

Updates the current page index and animates the PageView to the specified page.

index The index of the page to navigate to.

Implementation

void updateCurrentPageIndex(int index) {
  tabController.index = index;
  pageViewController.animateToPage(
    index,
    duration: const Duration(milliseconds: 400),
    curve: Curves.easeInOut,
  );
}