pushNamed method

Future<void> pushNamed({
  1. required String name,
  2. ResultCallback? onResult,
  3. Object? arguments,
  4. Widget? emptyPage,
  5. bool custom = true,
  6. String? restorationId,
  7. LaunchMode launchMode = LaunchMode.standard,
})

根据名称跳转页面

Implementation

Future<void> pushNamed(
    {required String name,
    ResultCallback? onResult,
    Object? arguments,
    Widget? emptyPage,
    bool custom = true,
    String? restorationId,
    LaunchMode launchMode = LaunchMode.standard}) {
  return _serializeNavigation(() async {
    final prepared = await _prepareNamedNavigation(
      name: name,
      custom: custom,
      emptyPage: emptyPage,
    );
    if (prepared == null) {
      return;
    }

    await _pushEntry(
        page: prepared.page,
        name: prepared.location,
        onResult: onResult,
        arguments: arguments,
        restorationId: restorationId,
        launchMode: launchMode);
  });
}