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