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

Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
  1. Widget child, {
  2. QuickTransition? transitions,
  3. TO? result,
})

A method that pushes a new route to the Navigator with the given child widget and transition type, and replaces the current route with the new one. It also returns an optional result to the previous route.

Defines the available transition options for animations. Only one transition can be selected at a time.

Available transitions:

The default transition is QuickFade.

Implementation

Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
    Widget child,
    {QuickTransition? transitions,
    TO? result}) {
  return Navigator.of(this).pushReplacement<T, TO>(
      QuickRouter.builder(child, transitions),
      result: result);
}