pushNamedAndRemoveUntil<T extends Object> abstract method

Future<T?> pushNamedAndRemoveUntil<T extends Object>(
  1. String newRouteName,
  2. bool predicate(
    1. Route
    ), {
  3. Object? arguments,
})

Push the route with the given name onto the navigator that most tightly encloses the given context, and then remove all the previous routes until the predicate returns true.

Modular.to.pushNamedAndRemoveUntil('/home/10', ModalRoute.withName('/'));

You could give parameters

Modular.to.pushNamedAndRemoveUntil('/home', ModalRoute.withName('/'), arguments: 10);

Implementation

Future<T?> pushNamedAndRemoveUntil<T extends Object>(
    String newRouteName, bool Function(Route<dynamic>) predicate,
    {Object? arguments});