pushReplacement<T extends Object, TO extends Object> abstract method

Future<T?> pushReplacement<T extends Object, TO extends Object>(
  1. Route<T> newRoute, {
  2. TO? result,
})

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

Modular.to.pushReplacement(
  MaterialPageRoute(builder: (context) => HomePage())
);

Implementation

Future<T?> pushReplacement<T extends Object, TO extends Object>(
    Route<T> newRoute,
    {TO? result});