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

Future<T?> toReplace<T extends Object?, TO extends Object?>(
  1. Widget page
)

Replaces the current route with a new page.

Implementation

Future<T?> toReplace<T extends Object?, TO extends Object?>(Widget page) =>
    Navigator.of(this)
        .pushReplacement<T, TO>(MaterialPageRoute(builder: (_) => page));