next method

void next()

Implementation

void next() {
  cancelHider();
  currentIndex = currentIndex! + 1;
  if (currentIndex! >= stories.length) {
    if (viewer!.loop) {
      currentIndex = 0;
      _callFunctions(_onIndexChangeds);
      play();
    } else {
      currentIndex = stories.length - 1;
      animationController.removeStatusListener(statusListener);
      animationController.animateTo(
        animationController.upperBound,
        duration: Duration(
          milliseconds: 1,
        ),
      );
      complated();
      return;
    }
  }
  animationController.reset();
  animationController.duration = currentStory.duration;
  _callFunctions(_onIndexChangeds);
}