openPageAndReplace static method

void openPageAndReplace(
  1. String routeName, {
  2. Object? extra,
})

跳转页面并替换当前页面 (使用 replaceNamed,符合参考实现)

Implementation

static void openPageAndReplace(String routeName, {Object? extra}) {
  if (context != null) {
    context!.replaceNamed(routeName, extra: extra);
  }
}