of static method

GoRouter of(
  1. BuildContext context
)

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;
}