of static method
Find the current GoRouter in the widget tree.
Implementation
static GoRouter of(BuildContext context) {
final GoRouter? router = maybeOf(context);
if (router == null) {
throw FlutterError('No GoRouter found in context');
}
return router;
}