pushReplacementNamed<T extends Object?, TO extends Object?> static method

Future<T?> pushReplacementNamed<T extends Object?, TO extends Object?>(
  1. String routeName, {
  2. TO? result,
  3. Object? arguments,
})

仿照 Navigator.pushReplacementNamed 的方法,(会回调路由栈里的下一个页面的onResume和onPause方法)

Implementation

static Future<T?> pushReplacementNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) {
  return Navigator.pushReplacement(navigatorKey.currentContext!, instance._routeNamed(routeName, arguments: arguments), result: result);
}