pushNamed method
Future<void>
pushNamed({
- required String name,
- ResultCallback? onResult,
- Object? arguments,
- Widget? emptyPage,
- bool custom = true,
- String? restorationId,
- 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);
});
}