to method
- @Deprecated("Avoid use this instance, you should use context.navigator.push(...)")
Do that:
Navigator.push(
transition
? MaterialPageRoute(builder: (_) => page)
: PageRouteBuilder(pageBuilder: (_, __, ___) => page),
);
Implementation
@Deprecated(
"Avoid use this instance, you should use context.navigator.push(...)")
Future<void> to(Widget page, {bool transition = true}) async {
await Navigator.push(this, _pageRoute(page, transition));
}