The next-generation Flutter router — typed, fast, and built from first principles.

Published on pub.dev as flow_routing.
context.flow(Routes.home);
context.flow(Routes.user(id: 42));
context.flow(Routes.about, push: true);
context.pop();
Routes.user(id: 5).location; // → "/users/5"| Feature | Flow | GoRouter | AutoRoute |
|---|---|---|---|
| Typed routes | ✅ First-class | ✅ Codegen required | |
| No code generation | ✅ | ✅ | ❌ |
| Separated nav stacks | ✅ | ❌ | |
| Pipeline guards | ✅ | ✅ | |
| Web-first URLs | ✅ | ✅ | |
| Optional middleware | ✅ | ❌ | ❌ |
- Instance routes —
Routes.user(id: 42)not'/users/42' - Unified navigation —
context.flow()for go and push;context.pop()to go back - Reverse routing — URLs generated automatically via
.location - Pipeline guards — composable auth, roles, async validation
- Middleware — logging, analytics, localization hooks
- Separated stacks — declarative
flowvs overlayflow(..., push: true) - Web support — clean URLs, browser history, refresh-safe parsing
- Transitions — material, fade, slide, none
- Shell routes — nested navigation and tab branches
- Testing —
FakeFlowRouter, engine unit tests, widget tests - Migration — helpers for GoRouter, Navigator, AutoRoute, Beamer
dependencies:
flow_routing: ^2.0.0import 'package:flow_routing/flow_routing.dart';
abstract final class Routes {
static const home = FlowRoute(name: 'home', pathTemplate: '/');
}
final router = FlowRouter(
routes: [
flow('/', name: 'home', builder: (context, route) => const HomePage()),
],
);
void main() => runApp(FlowApp.router(router: router));See Getting Started for the full guide.
A polished demo showcasing typed navigation, guards, middleware, and web URLs:
cd example
flutter run -d chrome # Web
flutter run # Mobile| Guide | Description |
|---|---|
| Getting Started | Install and first routes |
| API Reference | Complete public API |
| Architecture | System design |
| Cookbook | Recipes and patterns |
| Migration | From GoRouter, AutoRoute, etc. |
| GoRouter Issues | How Flow addresses 287+ issues |
flow/
├── lib/ # Package source
├── example/ # Demo application
├── docs/ # Documentation
├── test/ # Unit & widget tests
└── benchmark/ # Performance benchmarks
MIT — see LICENSE.