toNamed method
Future<T?>
toNamed(
- String page, {
- Object? arguments,
- String? id,
- bool preventDuplicates = true,
- Map<
String, String> ? parameters,
override
Navigates to a named page and returns a result of type T
.
Implementation
@override
Future<T?> toNamed(
String page, {
Object? arguments,
String? id,
bool preventDuplicates = true,
Map<String, String>? parameters,
}) async {
final PageSettings args = _buildPageSettings(page, arguments);
final RouteDecoder<T>? route = _getRouteDecoder(args);
if (route != null) {
return _push(route);
} else {
await goToUnknownPage();
}
return null;
}