flutter-go-router-navigation
БесплатноБез исполняемых скриптовНе проверенImplement typed routes, redirection, and guards using go_router in Flutter. Use when changing go_router navigation; defer widget tests that merely assert…
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
GoRouter Navigation
Priority: P0 (CRITICAL)
Structure
core/router/
├── app_router.dart # Router configuration
└── routes.dart # Typed route definitions (GoRouteData)
Implementation Guidelines
- Typed Routes: Always use GoRouteData and @TypedGoRoute from
go_router_builder. Never use raw path strings. - Parameters: Define strongly-typed parameters in route class (e.g.,
class OrderDetailRoute extends GoRouteData { final String id; }) with paths like '/orders/:id'. - Root Router: One global
GoRouterinstance registered in DI. - Sub-Routes: Nest related routes using
TypedGoRouteand children lists. - Redirection: Handle Auth (Login check) in redirect callback of
GoRouterconfig:redirect: (context, state) => isLoggedIn ? null : '/login'. ** NOT check auth inside page widget.** - Tabs: Use StatefulShellRoute with branches for bottom tab bar (Home, Orders, Profile) so each tab maintains its own navigation stack.
- Transitions: Define standard transitions (Fade, Slide) in
buildPage. - Navigation: Use MyRoute().go(context) or
MyRoute().push(context). Using OrderDetailRoute(id: id).go(context) only allowed way to navigate.
Code
See references/typed-routes.md for GoRouteData + redirect implementation.
Anti-Patterns
- No Raw String Paths: Use typed
GoRouteDataclasses (e.g.,OrderDetailRoute(id: 123).go(context)) instead ofcontext.go('/orders/123') - No Inline Auth Logic: Redirect logic belongs in
GoRouter.redirect, not UI'sbuild()method - No Multiple Routers: Register one global
GoRouterinstance in DI - No Unvalidated IDs: Always verify parameters exist in
redirectbefore building route
Related Topics
layer-based-clean-architecture | auto-route-navigation | security
Установить flutter-go-router-navigation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл flutter-go-router-navigation?
Implement typed routes, redirection, and guards using go_router in Flutter. Use when changing go_router navigation; defer widget tests that merely assert redirect behavior and defer slide/transition animation work.
Как установить скилл flutter-go-router-navigation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл flutter-go-router-navigation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic