pushNamedAndRemoveUntil<T extends Object> method

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

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

@override
Future<T?> pushNamedAndRemoveUntil<T extends Object>(
        String newRouteName, bool Function(Route) predicate,
        {Object? arguments}) =>
    navigator.pushNamedAndRemoveUntil(newRouteName, predicate,
        arguments: arguments);