pushReplacementNamed<T extends Object, TO extends Object> method
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);