navigation
Installation
SKILL.md
Navigation
Routing and navigation best practices for Flutter applications using GoRouter, the Flutter team's recommended routing package built on the Navigator 2.0 API.
Core Standards
Apply these standards to ALL navigation work:
- Use
package:go_routerfor all navigation — never raw Navigator 2.0 or Navigator 1.0 push/pop - Use
@TypedGoRouteannotations for type-safe routes — never raw string paths in route definitions - Prefer
go()overpush()— usepush()only when expecting return data from the destination - Never use the
extraparameter — it breaks deep linking and does not work on the web - Hierarchical sub-routes for proper back navigation — structure routes as parent-child trees, not flat lists
- Hyphens for URL word separation — never underscores or camelCase in URL paths
- Navigate by route name, not raw path strings — use named route navigation to decouple from path changes
- Use
BuildContextextensions for navigation — prefercontext.goNamed()overGoRouter.of(context).goNamed()