GetX Navigation
Priority: P0 (CRITICAL)
Guidelines
- Named Routes: Use
Get.toNamed('/path'). Define routes inAppPages. - Navigation APIs:
Get.to(): Push new route.Get.off(): Replace current route.Get.offAll(): Clear stack and push.Get.back(): Pop route/dialog/bottomSheet.- Bindings: Link routes with
Bindingsfor automated lifecycle. - Middleware: Implement
GetMiddlewarefor Auth/Permission guards.
Code Example
See AppPages Config for route definition and controller usage patterns.
Anti-Patterns
- Navigator Context: not use
Navigator.of(context)with GetX. - Hardcoded Routes: Use
Routesconstant class. - Direct Dialogs: Use
Get.dialog()andGet.snackbar().
References
Related Topics
getx-state-management | feature-based-clean-architecture