autoMoveToNextIndex method

void autoMoveToNextIndex()

Implementation

void autoMoveToNextIndex() {
  if (!mounted) {
    return;
  }
  if (!widget.autoScroll) return;

  _innerPageIndex++;
  _innerPageIndex = _innerPageIndex % innerPageCount;
  Duration duration = widget.animateDuration;
  debugLog("autoMoveToNextIndex $_innerPageIndex");
  if (_innerPageIndex == 0) {
    this._pageController!.jumpToPage(_innerPageIndex + 1);
    SchedulerBinding.instance!.addPostFrameCallback((timeStamp) {
      autoMoveToNextIndex();
      setState(() {});
    });
  } else {
    this._pageController!.animateToPage(_innerPageIndex,
        duration: duration, curve: Curves.easeInOut);
  }
}