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