toPushNamedAndClearUntil function
void
toPushNamedAndClearUntil(
- String routeName,
- RoutePredicate predicate, {
- Map<
String, dynamic> ? arguments,
Push a named route onto the navigation stack and remove routes until a specified predicate is met.
Example:
toPushNamedAndClearUntil('/login', ModalRoute.withName('/dashboard'));
Implementation
void toPushNamedAndClearUntil(String routeName, RoutePredicate predicate,
{Map<String, dynamic>? arguments}) {
Navigator.of(Utils.navigatorKey.currentContext!).pushNamedAndRemoveUntil(
routeName,
predicate,
arguments: arguments,
);
}