GoRouter.dev

Current field guide · 2026

Trace the route, not the symptom

Inspect the requested URI, matched hierarchy, redirect decisions, and selected Navigator before changing your configuration.

Edition published 21 Oct 2026go_router 18.1.1 reference
On this page

Turn on route diagnostics

Enable debugLogDiagnostics while developing. Use logs to compare the destination you requested with the route map you actually registered. Avoid logging complete user URLs if they can contain sensitive query values.

Narrow the failure

Does the problem happen before matching, during redirection, while building a screen, or only after browser reload? A route that works through a button but fails after refresh often points to hosting rather than the route builder.

Check shell ownership

When a page appears underneath a tab bar instead of above it, inspect the Navigator keys and parentNavigatorKey. When a tab loses state, check whether the design uses separate stateful branches and whether keys or router instances are being recreated.

Reduce before reporting

Build the smallest route tree that still fails. Record package and Flutter versions, entry URI, steps, expected behavior, and actual behavior. Remove tokens and private data before attaching logs to an upstream issue.

dart / example
final router = GoRouter(
  debugLogDiagnostics: true,
  routes: routes,
  errorBuilder: (context, state) => UnknownLocationScreen(
    message: 'This location is not available.',
  ),
);
Earlier edition: read the complete original guide. Its older APIs are kept in historical context.

Sources & version context

GoRouter.dev documentation edition. Examples illustrate the APIs described in the linked primary documentation. Adapt application-owned widgets and services to your project. They are not an executed Flutter session in this browser.

How to file a routing report someone else can reproduce

A report about a missing route parameter needs the route pattern and the supplied keys. Before sharing it, replace account IDs, hostnames and query values with synthetic equivalents. Keep the separators and the missing key intact. A replacement that silently adds the missing value destroys the example.

Filled teaching report: dependency being investigated — go_router 18.1.5; environment — browser, exact Flutter and Dart versions to be copied from the reporter’s own flutter --version; start — /books; route name — book; pattern — /books/:bookId; action — build a named location with an empty parameter map. Expected by the reporter — open /books/demo; observed — leave blank until the real run. Control case — repeat with bookId set to demo. This is a report-writing exercise, with no claimed execution result.

Paste the shortest route declaration, the two parameter maps and the first relevant diagnostic line. Record whether refresh or a new tab changes the result. If your control also fails, say so and keep both logs. Attach the exact resolved package version from the lockfile. Share a public issue only after removing tokens and personal details.

One change between two runs. Keep the starting route, action and expected address identical. Record actual behaviour and attach only the smallest redacted example.
Keep the starting route, action and expected address identical. Record actual behaviour and attach only the smallest redacted example. © gorouter.dev, CC BY 4.0.

Flutter issue templates

Which version should a route documentation correction name?

Suppose a bug report quotes the 18.1.1 guide and assumes that a route state always has a name. The 18.1.5 changelog records a documentation clarification about when GoRouterState.name and GoRouterState.path are null. Start the correction by linking the exact guide revision that the reporter read and the release containing the clarification.

Open the project’s pubspec.lock and copy the version for go_router into a third field. If all you have is a dependency constraint, leave the resolved version unknown. Example record: quoted guide 18.1.1, clarification 18.1.5, installed package unknown. A correction can point to the newer description without claiming the project upgraded.

To close the documentation question, check the two fields in the API reference for the recorded release, then quote the condition that applies to the reported route. Record a runtime result only after testing that project. This is a source comparison; no Flutter build is required to reproduce the three-field record.

A three-field correction record. An older documentation page, a newer clarification and the version in a local project answer three different questions.
An older documentation page, a newer clarification and the version in a local project answer three different questions. © gorouter.dev, CC BY 4.0.

Flutter team’s go_router changelog

Find your next route