go_router

The official Flutter navigation library (Google-maintained, part of flutter/packages). go_router provides URL-based declarative routing for Flutter with deep linking, nested navigation, parameterized routes, and redirect support. Replaces Flutter's imperative Navigator 1.0 push/pop API with a URL-driven Router 2.0 approach — routes are defined as a tree, navigation is done with context.go('/path') or context.push('/path').

Evaluated Mar 06, 2026 (0d ago) v13.x
Homepage ↗ Repo ↗ Developer Tools dart flutter routing navigation deep-linking url-based declarative
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
89
/ 100
Is it safe for agents?
⚡ Reliability
85
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
82
Auth Simplicity
92
Rate Limits
95

🔒 Security

TLS Enforcement
100
Auth Strength
85
Scope Granularity
80
Dep. Hygiene
92
Secret Handling
88

Client-side routing library — no network exposure. Route guards via redirect prevent unauthorized access. Deep link validation should check source before processing.

⚡ Reliability

Uptime/SLA
90
Version Stability
85
Breaking Changes
80
Error Recovery
85
AF Security Reliability

Best When

You're building a non-trivial Flutter app and need URL-based routing, deep linking, or authentication guards — go_router is the official recommended Flutter routing solution.

Avoid When

Your Flutter app is simple with 2-3 screens and no deep linking needs — Navigator.push/pop is simpler. go_router adds configuration overhead for simple apps.

Use Cases

  • Define type-safe URL routes for Flutter agent apps with parameterized paths — go_router parses path params (/agent/:id) and query params automatically
  • Implement deep linking in Flutter apps so agent workflow URLs (yourapp://workflow/123) navigate directly to the correct screen
  • Add authentication guards using go_router redirect callbacks that check auth state and redirect unauthenticated users to login
  • Build nested navigation with ShellRoute for Flutter apps that have bottom navigation bars with independent navigation stacks per tab
  • Generate typed route classes using go_router_builder code generation — compile-time safe route parameters instead of string paths

Not For

  • Flutter Web apps with complex browser history requirements — go_router handles basic browser history but complex web navigation may need custom history management
  • Apps still on Navigator 1.0 that aren't migrating — go_router requires Router 2.0 setup; not a drop-in replacement without refactoring
  • React Native or other non-Flutter frameworks — React Navigation is the equivalent for React Native

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

go_router is a routing library — authentication state is checked in redirect callbacks. Common pattern: redirect to '/login' if auth provider state is unauthenticated.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

go_router is maintained by Google as part of flutter/packages and is BSD-3-Clause licensed. Free for all use.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • context.go vs context.push semantics — go() replaces the entire navigation stack to the new route, push() adds to the stack; using go() where push() is intended loses back navigation history
  • Redirect loops — if redirect callback redirects based on state that the redirect destination also redirects from, infinite loops occur; always ensure redirect destination has no further redirects
  • Nested routes require matching parent path prefix — child routes must include parent path: '/parent/child', not just '/child'; route tree mismatches cause NoRoutesException
  • GoRouter is a widget and must be provided to MaterialApp.router — using MaterialApp (non-router) with go_router causes context.go to fail silently or throw
  • StatefulShellRoute replaces Navigator 1.0 IndexedStack pattern — migrating bottom nav apps from imperative to go_router requires replacing IndexedStack with StatefulShellRoute branches
  • go_router_builder code gen requires running build_runner — forgetting to regenerate typed routes after adding new GoRoute definitions causes compile errors in generated code

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for go_router.

$99

Scores are editorial opinions as of 2026-03-06.

5229
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered