maybeOf static method

RouterState? maybeOf(
  1. BuildContext context
)

Implementation

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