pushAndRemoveUntil function
Future
pushAndRemoveUntil(
- BuildContext context,
- Widget widget,
- Widget? untilPage, {
- bool authCheck = true,
you can pass null to untilPage
and it will clear the stack
Implementation
Future pushAndRemoveUntil(
BuildContext context,
Widget widget,
Widget? untilPage, {
bool authCheck = true,
}) {
return _safeNav(
context,
widget,
() {
return Navigator.pushAndRemoveUntil(
context,
materialRoute(widget),
(Route<dynamic> route) =>
route.settings.name == untilPage.runtimeType.toString(),
);
},
authCheck: authCheck,
);
}