flutter-navigation
Skill106 starsChanged 7 months agoMITView on GitHub
Implement, fix, refactor, review, migrate, or validate Flutter navigation and routing. Use when working with Navigator, MaterialPageRoute, Router API, go_router, route guards, redirects, ShellRoute or StatefulShellRoute, nested Navigators, passing and returning route data, deep links, Android App Links, iOS Universal Links, custom URI schemes, Flutter web URL strategy, browser history, 404 routing, route tests, or navigation-state bugs.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- thienqo/flutter-skillstheir own version, first seen Nov 1, 2026
- thiennc-tesoglobal/flutter-skillstheir own version, first seen Aug 30, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- thiennc-tesoglobal/flutter-skills★ 16same name
- thienqo/flutter-skills★ 16same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- agents-md-generatorSkill
- dart-driftSkill
- flutter-adaptive-uiSkill
- flutter-animationsSkill
- flutter-architectureSkill
- flutter-driftSkill
- flutter-duit-bduiSkill
- flutter-internationalizationSkill
- flutter-networkingSkill
- flutter-testingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 9 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Use Navigator with MaterialPageRoute for local, non-addressable flows in simple apps.
- Very specific: line 40
Use go_router for deep links, web URLs, browser history, auth redirects, nested navigation, multiple Navigators, or scalable route tables.
- Very specific: line 42
Avoid new legacy MaterialApp.routes named routes unless preserving a small existing app that already uses them and does not need custom …
- Distinctive: line 51
Add or update tests for the changed route behavior when feasible.
- Distinctive: line 73
Read only the resources needed for the current task:
- Distinctive: line 86
Do not read every reference by default.
- Very specific: line 91
Do not mix primary navigation models casually.
- Very specific: line 98
Read query parameters from state.uri.queryParameters and path parameters from state.pathParameters.
- Distinctive: line 100
Do not store complex state only in a URL.
- Very specific: line 103
Do not use extra for data that must survive refresh, browser restore, sharing, or a native deep link.
- Distinctive: line 106
Keep auth redirects loop-free.
- Distinctive: line 113
Do not copy assets blindly.
- Distinctive: line 118
After changing a Flutter project:
- Very specific: line 120
Run dart format on edited Dart files.
- Very specific: line 121
Run flutter analyze for the project or closest package.
- Very specific: line 122
Run focused flutter test suites when route parsing, redirects, shell/tab state, returned results, or navigation UI changed.
- Very specific: line 129
If only this skill's Dart assets changed, validate them in a scratch Flutter app with the required dependencies, then run dart format …
- Distinctive: line 133
If validation cannot run, report the command, blocker, and the route behavior that remains unverified.
- Distinctive: line 139
If the target project is unavailable, provide a route plan or patch sketch based only on the user's supplied files and state the missing …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Navigation
You are a Flutter navigation implementation agent. Your job is to make route state, browser/deep-link behavior, and screen transitions fit the target app without breaking existing state, auth flows, or platform expectations.
Principle 0
Navigation is user state. Do not replace an app's routing model or add deep-link
claims before inspecting the current MaterialApp, Router, Navigator,
state-management, auth, supported platforms, and tests. After changing
navigation, verify analyzer-clean Dart and the route behaviors affected by the
change.
Workflow
- Identify the request: simple screen transition, data passing, returned result, route migration, deep-link setup, web browser history, nested tabs or shells, auth redirect, route error handling, or navigation test.
- Inspect the local Flutter project first when code is available:
pubspec.yaml,lib/, app root, existing route definitions, navigation calls, auth/state providers, platform folders, web hosting config, and relevant tests. - Choose the smallest routing model that satisfies the product requirement:
- Use
NavigatorwithMaterialPageRoutefor local, non-addressable flows in simple apps. - Use
go_routerfor deep links, web URLs, browser history, auth redirects, nested navigation, multiple Navigators, or scalable route tables. - Avoid new legacy
MaterialApp.routesnamed routes unless preserving a small existing app that already uses them and does not need custom deep-link behavior.
- Use
- Model route data deliberately. Use constructor arguments for local Navigator
pushes, path parameters for required addressable identity, query parameters
for optional URL state, and
extraonly for non-addressable in-memory data. - Implement in the app's existing style. Preserve stable URLs, route names, selected tab state, back behavior, state restoration, analytics observers, and auth redirect semantics unless the user asked to change them.
- Add or update tests for the changed route behavior when feasible. Cover route parsing, redirects, shell/tab selection, result returns, and not-found/error screens according to the requested change.
- Validate with the strongest local checks available. Report skipped runtime, device, server, or deep-link validation explicitly.
Decision Guide
| Need | Default approach |
| Push one detail screen and return | Navigator.push<T> with MaterialPageRoute<T> |
| Share/bookmark/browser route | go_router with URL-based locations |
| Required resource identity | Path parameter, for example /users/:userId |
| Optional filters, tabs, or search state | Query parameters via Uri(...).toString() |
| Auth gate or onboarding gate | go_router redirect or onEnter, tied to app auth state |
| Persistent navigation chrome | ShellRoute; use StatefulShellRoute when branches need independent stacks |
| Web path URLs | usePathUrlStrategy() plus SPA server rewrite to index.html |
| Native verified web links | Android App Links or iOS Universal Links plus hosted association files |
| Custom app-only URI | Custom scheme, with explicit security and fallback tradeoffs |
Resource Routing
Read only the resources needed for the current task:
| Task | Read/use | Purpose |
| Choosing Navigator vs go_router or reviewing route tradeoffs | navigation-patterns.md | Approach comparison, data passing, and browser/deep-link limitations |
| Implementing or fixing go_router route tables, redirects, shells, errors, named routes, or route data | go_router-guide.md | Current go_router APIs and common pitfalls |
| Configuring Android App Links, iOS Universal Links, custom schemes, or deep-link tests | deep-linking.md | Platform setup, association files, Flutter handler notes, and test commands |
| Fixing Flutter web URLs, browser history, SPA rewrites, or non-root hosting | web-navigation.md | URL strategies, server rewrites, and web-specific validation |
| Need a minimal Navigator starter | navigator_basic.dart | Copy only after adapting class names and app shell |
| Need a minimal go_router starter | go_router_basic.dart | Copy only after adding the dependency and adapting routes |
| Need local data passing with Navigator | passing_data.dart | Copy only after replacing demo model and screen names |
| Need returned data with Navigator | returning_data.dart | Copy only after handling null/cancelled results appropriately |
Do not read every reference by default. Treat references as routed detail and assets as starter examples, not production modules.
Implementation Rules
- Do not mix primary navigation models casually. If the app uses
go_router, prefercontext.go,context.push,context.goNamed, orcontext.pushNamedfor main app routes. Use imperativeNavigatoronly for local overlays or flows that are intentionally not deep-linkable. - Build query-string locations with
Uri(path: ..., queryParameters: ...).toString()or go_router named-route APIs. Do not pass aqueryParametersargument tocontext.pushorcontext.go. - Read query parameters from
state.uri.queryParametersand path parameters fromstate.pathParameters. - Do not store complex state only in a URL. Parse and validate route strings, convert IDs and enum-like values safely, and handle missing or invalid values with redirect, error screen, fallback UI, or 404 behavior.
- Do not use
extrafor data that must survive refresh, browser restore, sharing, or a native deep link. If complexextrais required on web, configure a codec or accept that data can be dropped. - Keep auth redirects loop-free. Preserve intended destination when login or onboarding should return the user to their original route.
- For iOS Universal Links, configure Associated Domains in Xcode or
ios/Runner/Runner.entitlements, not as anInfo.plistroute table. - For web path strategy, update
web/index.htmlbase href and server rewrites when hosting below a non-root path. Do not encode the hosting prefix into everyGoRoute.pathunless the target app already uses that convention. - Do not copy assets blindly. Adapt imports, route names, keys, app shell, package versions, null-safety, lints, and tests to the target project.
Validation
After changing a Flutter project:
- Run
dart formaton edited Dart files. - Run
flutter analyzefor the project or closest package. - Run focused
flutter testsuites when route parsing, redirects, shell/tab state, returned results, or navigation UI changed. - For web URL changes, run the app in Chrome when feasible and verify direct load, refresh, back, forward, and not-found behavior for changed routes.
- For deep links, test the exact target URLs with
adb,xcrun simctl, or Flutter DevTools Deep Links validation when the platform and device are available. - If only this skill's Dart assets changed, validate them in a scratch Flutter
app with the required dependencies, then run
dart format --output=none --set-exit-if-changedandflutter analyze.
If validation cannot run, report the command, blocker, and the route behavior that remains unverified. Do not present navigation, browser-history, or deep-link behavior as verified from static reading alone.
Fallback
If the target project is unavailable, provide a route plan or patch sketch based only on the user's supplied files and state the missing verification. If the app already has an inconsistent routing model, make the smallest reversible fix first, then propose a staged migration rather than replacing routing wholesale.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

