navigation

Featured

Best practices for navigation and routing in Flutter using GoRouter, covering hierarchical route trees, type-safe `@TypedGoRoute` definitions, named navigation, redirects, and deep linking setup. Use when creating, modifying, or reviewing routes, deep links, redirects, or navigation logic that uses package:go_router or package:go_router_builder, including widget tests that mock GoRouter or provide it through `InheritedGoRouter`. Route motion belongs to the animations skill, even inside a `GoRouteData` subclass.

Testing & QA 161 stars 22 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
74
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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_router` for all navigation** — never raw Navigator 2.0 or Navigator 1.0 push/pop - **Use `@TypedGoRoute` annotations for type-safe routes** — never raw string paths in route definitions - **Prefer `go()` over `push()`** — use `push()` only when expecting return data from the destination - **Never use the `extra` parameter** — 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 `BuildContext` extensions for navigation** — prefer `context.goNamed()` over `GoRouter.of(context).goNamed()` ## Route Organization Structure routes hierarchically with logical parent-child relationships. Sub-routes ensure the app bar back button displays correctly and URLs remain clean. ### Hierarchical Structure (Preferred) ```text /flutter /flutter/news /flutter/chat /flutter/articles /flutter/articles?category=all /flutter/article/:id /android /android/news /android/chat ``` ### Flat Structure (Avoid) ```text /f...

Details

Author
VeryGoodOpenSource
Repository
VeryGoodOpenSource/vgv-ai-flutter-plugin
Created
6 months ago
Last Updated
yesterday
Language
Shell
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category