animateToPage method

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

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.

The duration and curve arguments must not be null.


Future<void> animateToPage(
  int page, {
  Duration duration,
  Curve curve,
}) {
  final _CustomPagePosition position = this.position as _CustomPagePosition;
  return position.animateTo(
    duration: duration,
    curve: curve,