maybeOf static method
Implementation
static RouterState? maybeOf(BuildContext context) {
if (context is StatefulElement && context.state is RouterState) {
return context.state as RouterState;
}
return context.dependOnInheritedComponentOfExactType<InheritedRouter>()?.router;
}