animateToPage method

  1. @override
Future<void> animateToPage(
  1. int page,
  2. {required Duration duration,
  3. required Curve curve}
)
override

Animates the controlled PageView from the current page to the given page.

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

Implementation

@override
Future<void> animateToPage(
  int page, {
  required Duration duration,
  required Curve curve,
}) {
  currentDate.value = _pageToDate(page);
  return super.animateToPage(page, duration: duration, curve: curve);
}