# Flutter Getx Navigation

> Context-less navigation, named routes, and middleware using GetX. Use when this capability is needed.

- Skill: `tomevault-io/flutter-getx-navigation` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/flutter-getx-navigation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/flutter-getx-navigation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/flutter-getx-navigation

---


# GetX Navigation

## **Priority: P0 (CRITICAL)**

Decoupled navigation system allowing UI transitions without `BuildContext`.

## Guidelines

- **Named Routes**: Use `Get.toNamed('/path')`. Define routes in `AppPages`.
- **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 `Bindings` for automated lifecycle.
- **Middleware**: Implement `GetMiddleware` for Auth/Permission guards.

## Code Example

```dart
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 `Navigator.of(context)` with GetX.
- **Hardcoded Routes**: Use a `Routes` constant class.
- **Direct Dialogs**: Use `Get.dialog()` and `Get.snackbar()`.

## References

- [AppPages Config](references/app-pages.md)
- [Middleware Implementation](references/middleware-example.md)

## Related Topics

getx-state-management | feature-based-clean-architecture

---
> Source: [fierzone/agent-skills-standard](https://github.com/fierzone/agent-skills-standard) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-16 -->

