prevPage method

dynamic prevPage(
  1. dynamic index
)

Implementation

prevPage(index) {
  if (index == 0) return;
  setState(() {
    selectedIndex = index - 1;
  });
  _pageController!.animateToPage(selectedIndex!,
      duration: const Duration(milliseconds: 100), curve: Curves.easeIn);
}