of static method
Find the current GoRouter in the widget tree.
This method throws when it is called during redirects.
Implementation
static GoRouter of(BuildContext context) {
final GoRouter? inherited = maybeOf(context);
assert(inherited != null, 'No GoRouter found in context');
return inherited!;
}