pushNamed method

void pushNamed({
  1. required String name,
  2. ResultCallBack? onResult,
  3. Object? arguments,
  4. Widget? emptyPage,
  5. bool custom = true,
  6. String? restorationId,
})

根据名称跳转页面

Implementation

void pushNamed(
    {required String name,
      ResultCallBack? onResult,
    Object? arguments,
    Widget? emptyPage,
    bool custom = true,
    String? restorationId}) {
  var page = pageMap?[name];
  _location = name;
  if (custom && page == null) {
    page = _routePathCallBack
        ?.call(RouteInformation(uri: Uri.parse(_location!)));
  }
  if (page == null) {
    _location = '404';
    page = emptyPage ?? const EmptyPage();
  }
  push(
      page: page,
      name: name,
      onResult: onResult,
      arguments: arguments,
      restorationId: restorationId);
}