toPage method
Animates the parent PageView from the current page to the given page.
Implementation
Future<void> toPage(
int page, {
Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.ease,
}) async =>
pageController.animateToPage(page, duration: duration, curve: curve);