pushReplacementNamed<T extends Object, TO extends Object> method

  1. @override
Future<T?> pushReplacementNamed<T extends Object, TO extends Object>(
  1. String routeName, {
  2. TO? result,
  3. Object? arguments,
})
override

Replace the current route of the navigator that most tightly encloses the given context by pushing the route named routeName and then disposing the previous route once the new route has finished animating in.

Modular.to.pushReplacementNamed('/home/10');

You could give parameters

Modular.to.pushReplacementNamed('/home', arguments: 10);

Implementation

@override
Future<T?> pushReplacementNamed<T extends Object, TO extends Object>(
        String routeName,
        {TO? result,
        Object? arguments}) =>
    navigator.pushReplacementNamed(routeName,
        result: result, arguments: arguments);