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

Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
  1. Widget widget, {
  2. PageRouteOptions options = const PageRouteOptions.material(),
  3. TO? result,
})

Implementation

Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
  Widget widget, {
  PageRouteOptions options = const PageRouteOptions.material(),
  TO? result,
}) {
  assert(FlExtended().navigatorKey.currentState != null,
      'Set FlExtended().navigatorKey to one of [MaterialApp CupertinoApp WidgetsApp]');
  return FlExtended()
      .navigatorKey
      .currentState!
      .pushReplacement<T, TO>(options.buildPageRoute(widget), result: result);
}