toNamed<T> method
Future<T?>
toNamed<
T>( - String name, {
- Map<String, String> pathParams = const <String, String>{},
- Map<String, dynamic> queryParams = const <String, dynamic>{},
- Map<String, dynamic> params = const <String, dynamic>{},
})
Implementation
Future<T?> toNamed<T>(
String name, {
Map<String, String> pathParams = const <String, String>{},
Map<String, dynamic> queryParams = const <String, dynamic>{},
Map<String, dynamic> params = const <String, dynamic>{},
}) {
if (GetPlatform.isWeb) {
goNamed(
name,
pathParams: pathParams,
queryParams: queryParams,
params: params,
);
return Future<T>.value(null);
} else {
return pushNamed<T>(
name,
pathParams: pathParams,
queryParams: queryParams,
params: params,
);
}
}