accessActiveRouteParamOfType<TRouteParam extends AFRouteParam> method
TRouteParam?
accessActiveRouteParamOfType<TRouteParam extends AFRouteParam>({
- AFRouteLocation routeLocation = AFRouteLocation.screenHierarchy,
inherited
Expectes to find exactly ione param of the specified type.
Searches the active screen in the hierarchy, the children of that screen, and any currently showing UIs (dialogs, etc)
Implementation
TRouteParam? accessActiveRouteParamOfType<TRouteParam extends AFRouteParam>({
AFRouteLocation routeLocation = AFRouteLocation.screenHierarchy
}) {
final found = accessActiveRouteParamsOfType<TRouteParam>(routeLocation: routeLocation);
assert(found.length < 2);
if(found.isEmpty) {
return null;
}
return found.first;
}