All features

Routing for Flutter

Declarative routing with GoRouter

Flutter Agent Kit ships GoRouter as its navigation system, wired through one hand-written provider, so an agent adds URL-based navigation, deep links and gated routes without code generation.

What this feature covers

  • Named routes and deep links: URL-based navigation the browser and the app stores both understand.
  • Nested routes: Path parameters and typed state.extra passed to a screen.
  • Redirect gating: A redirect callback that routes the user based on app state, such as auth.
  • Bottom navigation: StatefulShellRoute.indexed for a tab shell with independent navigation stacks.
  • Wiring: MaterialApp.router connected to the router provider.

How Flutter Agent Kit implements it

The kit writes a single Provider<GoRouter> by hand, gorouterProvider, plus a navigatorKeyProvider and a Routes constants class. There is no go_router_builder and no build_runner step: GoRoute instances are written directly, so the agent edits routes in plain Dart. It targets go_router 17, using state.uri.toString() instead of the removed state.location and notifyRootObserver on shell routes.

Navigation uses context.go, push, pop and pushNamed. Navigator.push(MaterialPageRoute) is banned because it bypasses the router and breaks deep links. Routing runs on Android, iOS, macOS and web, where path-based URLs are part of the web acceptance criteria.

Frequently asked questions

Does the kit require go_router_builder?

No. Type-safe routes require build_runner, which the kit bans. The agent writes GoRoute instances by hand inside a single gorouterProvider, so routes stay readable and there is no generated code to keep in sync.

How does route gating work?

A redirect callback reads app state, such as the auth or onboarding status, and sends the user to the right route. A refreshListenable is wired so the redirect re-evaluates when that state changes, instead of only on navigation.

Get Flutter Agent Kit

Flutter Agent Kit ships this as a ready feature skill, together with the AGENTS.md context layer and the rest of the skills. €99.99 one-time, lifetime updates, unlimited personal and commercial projects.

Browse all features included in Flutter Agent Kit.