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

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

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

Implementation

@optionalTypeArgs
Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
    Route<T> newRoute,
    {TO? result}) async {
  final push =
      await appNavigator?.pushReplacement<T, TO>(newRoute, result: result);
  return push;
}