$getRouteParam<U> method
U
$getRouteParam<
U>( - String key
)
inherited
Implementation
@protected
@nonVirtual
@internal
U $getRouteParam<U>(String key) {
if (this.widget.$hasWidgetWrapper()) {
return this.widget.$getRouteParamFromWidgetWrapper(key);
}
ModalRoute? modelRoute = ModalRoute.of(this.context);
if (modelRoute == null) {
throw "Cannot access ModalRoute.of(this.context) in ${this} for key [${key}]";
}
Object? args = modelRoute.settings.arguments;
if (args is! Map<String, dynamic>) {
throw "Provided arguments are not a Map<String, dynamic> in ${this} for key [${key}]. They are: ${args}";
}
Map<String, dynamic> map = args;
return map[key] as U;
}