next method

Future<void> next({
  1. Duration duration = const Duration(milliseconds: 200),
  2. Curve curve = Curves.ease,
})
inherited

Animates the current page to the next page. Does nothing if it is the last page.

Testing

To avoid timeouts in widget tests, always wrap the returned Future in unawaited.

testWidgets('shows', (tester) async {
  await tester.pumpWidget(...);

  unawaited(controller.show());
  await tester.pumpAndSettle();
});

Implementation

Future<void> next({Duration duration = const Duration(milliseconds: 200), Curve curve = Curves.ease}) async {
  if (_from(_current) case final page when page < _from(end)) {
    await _animateTo(page + 1, duration, curve);
  }
}