Skillshub flutter-getx-navigation
Context-less navigation, named routes, and middleware using GetX. Use when implementing navigation or route middleware with GetX in Flutter. (triggers: **/app_pages.dart, **/app_routes.dart, GetPage, Get.to, Get.off, Get.offAll, Get.toNamed, GetMiddleware)
install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/HoangNguyen0403/agent-skills-standard/flutter-getx-navigation" ~/.claude/skills/comeonoliver-skillshub-flutter-getx-navigation && rm -rf "$T"
manifest:
skills/HoangNguyen0403/agent-skills-standard/flutter-getx-navigation/SKILL.mdsource content
GetX Navigation
Priority: P0 (CRITICAL)
Decoupled navigation system allowing UI transitions without
BuildContext.
Guidelines
- Named Routes: Use
. Define routes inGet.toNamed('/path')
.AppPages - Navigation APIs:
: Push new route.Get.to()
: Replace current route.Get.off()
: Clear stack and push.Get.offAll()
: Pop route/dialog/bottomSheet.Get.back()
- Bindings: Link routes with
for automated lifecycle.Bindings - Middleware: Implement
for Auth/Permission guards.GetMiddleware
Code Example
static final routes = [ GetPage( name: _Paths.HOME, page: () => HomeView(), binding: HomeBinding(), middlewares: [AuthMiddleware()], ), ]; // Usage in Controller void logout() => Get.offAllNamed(Routes.LOGIN);
Anti-Patterns
- Navigator Context: Do not use
with GetX.Navigator.of(context) - Hardcoded Routes: Use a
constant class.Routes - Direct Dialogs: Use
andGet.dialog()
.Get.snackbar()
References
Related Topics
getx-state-management | feature-based-clean-architecture