nextPage method

Future<void> nextPage()

Implementation

Future<void> nextPage() async {
 if (_isLoading) {
   return;
 }
 if ((_currentIndex + 1) <= (widget.steps.length - 1)) {
   //Move to next step
   _showLoader();
   await Future.delayed(
     const Duration(
       milliseconds: 500,
     ),
   );
   await _pageController.nextPage(
     duration: const Duration(milliseconds: 500),
     curve: Curves.easeIn,
   );
   await Future.delayed(
     const Duration(seconds: 2),
   );
   _hideLoader();
   setState(() => _currentIndex++);
 } else {
   widget.onCompleted();
 }
  }