getCurrentParam<T extends RouterParam?> method
T?
getCurrentParam<T extends RouterParam?>()
Get the current route param without using context.
Implementation
T? getCurrentParam<T extends RouterParam?>() {
if (_currentRouteParam.runtimeType == _getType<T>()) {
return _currentRouteParam as T?;
}
print(
'getParam<$T>() ---> Invalid type: The active/current route param is of type "${_currentRouteParam.runtimeType}" while the parameter you want to access is of type "$T". Momentum will return a null instead.');
return null;
}