auto_route

Code-generated routing library for Flutter — the most feature-rich alternative to go_router and Flutter Navigator 2.0. auto_route generates type-safe route classes from annotations: @AutoRouterConfig(), @RoutePage() on widgets, and @injectable integration. Key features: type-safe route arguments (no string-based routing), route guards for auth, nested navigation stacks, tab navigation, deep linking, web URL synchronization, and declarative route tree definition. Works with get_it/injectable for DI.

Evaluated Mar 06, 2026 (0d ago) v9.x
Homepage ↗ Repo ↗ Developer Tools flutter dart navigation routing code-generation deep-linking guards nested-navigation
⚙ Agent Friendliness
65
/ 100
Can an agent use this?
🔒 Security
89
/ 100
Is it safe for agents?
⚡ Reliability
77
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
80
Error Messages
82
Auth Simplicity
95
Rate Limits
98

🔒 Security

TLS Enforcement
98
Auth Strength
88
Scope Granularity
85
Dep. Hygiene
85
Secret Handling
90

No network exposure. Route guards enforce auth before navigation. Type-safe routes prevent route injection via string manipulation. Deep link validation is application responsibility.

⚡ Reliability

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

Best When

You're building a large Flutter app with complex navigation (nested stacks, tabs, guards, deep links) and want type-safe route arguments and code generation for navigation boilerplate.

Avoid When

You have a simple app (few routes, no guards), your team avoids build_runner code gen, or you're already invested in go_router's simpler API.

Use Cases

  • Build type-safe Flutter navigation for agent apps using auto_route — compile-time route argument checking prevents runtime navigation errors in complex agent UI flows
  • Implement auth guards for agent feature routes using AutoRouteGuard — redirect unauthenticated users to login before accessing agent dashboards
  • Create nested navigation stacks for agent feature modules — separate navigation stacks per tab or feature (agents, settings, history) with independent back stacks
  • Handle deep links and URL routing for Flutter web agent dashboards using auto_route's web support — browser URL reflects app state, history navigation works correctly
  • Integrate route code generation with injectable DI — auto_route + injectable + get_it provide compile-time navigation and dependency injection together

Not For

  • Simple apps with few routes — auto_route adds build_runner code generation overhead; go_router or Navigator.pushNamed is simpler for apps with 3-5 screens
  • Teams avoiding code generation — auto_route requires running build_runner after route changes; teams wanting zero code generation should use go_router
  • Non-Flutter Dart apps — auto_route is Flutter-specific; server-side Dart routing uses shelf_router or other HTTP routing libraries

Interface

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

Authentication

Methods: none
OAuth: No Scopes: No

Routing library — no auth concepts. AutoRouteGuard interface enables auth-based navigation guards: check auth state and redirect unauthenticated users.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

auto_route is MIT licensed, maintained by Milad Akarie. Free for all use.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Code generation required after every route change — add/modify @RoutePage or @AutoRouterConfig requires `flutter pub run build_runner build`; forgetting this causes 'route not found' errors that look like runtime bugs
  • Part files must match — @RoutePage creates part files (route_name.gr.dart); the part directive in router config must match; version upgrades sometimes change generated file structure
  • AutoRouteGuard is async — guards return a NavigationDecision Future; blocking guard evaluation (waiting for auth check) delays navigation; use StreamProvider or StateNotifier for reactive auth state in guards
  • Nested routers require separate AutoRouter instances — each nested navigation area (tab, module) needs its own router; mixing routes between routers causes parent router to handle child routes incorrectly
  • Deep link configuration per platform — iOS requires Associated Domains entitlement and apple-app-site-association; Android requires intent-filter in AndroidManifest.xml; auto_route handles routing but platform setup is manual
  • back button behavior with nested navigation — Android hardware back button behavior in nested stacks requires careful AutoBackButton usage; default back handling may pop wrong stack in multi-stack navigation

Alternatives

Full Evaluation Report

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

$99

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

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