pushReplacementNamed<T extends Object?, TO extends Object?> abstract 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
Future<T?> pushReplacementNamed<T extends Object?, TO extends Object?>(
String routeName,
{TO? result,
Object? arguments,
bool forRoot = false});