previousPage method

Future<void> previousPage({
  1. Duration? duration = const Duration(milliseconds: 300),
  2. Curve? curve = Curves.linear,
})
override

Animates the controlled CarouselSlider to the previous page.

The animation lasts for the given duration and follows the given curve. The returned Future resolves when the animation completes.

Implementation

Future<void> previousPage({Duration? duration = const Duration(milliseconds: 300), Curve? curve = Curves.linear}) async {
  final bool isNeedResetTimer = _state!.options.pauseAutoPlayOnManualNavigate;
  if (isNeedResetTimer) {
    _state!.onResetTimer();
  }
  _setModeController();
  await _state!.pageController!.previousPage(duration: duration!, curve: curve!);
  if (isNeedResetTimer) {
    _state!.onResumeTimer();
  }
}