pushReplacementNamed<T extends Object?, TO extends Object?> abstract method

Future<T?> pushReplacementNamed<T extends Object?, TO extends Object?>(
  1. String routeName, {
  2. TO? result,
  3. Object? arguments,
  4. bool forRoot = false,
})

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});