Context-less navigation, named routes, and middleware using GetX.
Decoupled navigation system allowing UI transitions without BuildContext.
Get.toNamed('/path') for better maintainability. Define routes in a centralized AppPages class.Get.to(), Get.back(), etc., directly from controllers.Get.to(): Navigate to next screen.Get.off(): Navigate and replace current screen (e.g., Splash -> Home).Get.offAll(): Clear stack and navigate (e.g., Logout -> Login).Get.back(): Close current screen, dialog, or bottom sheet.Bindings to manage controller lifecycles.GetMiddleware for route guards (Auth, Permissions) instead of logic inside views.// Route Definition
static final routes = [
GetPage(
name: _Paths.HOME,
page: () => HomeView(),
binding: HomeBinding(),
middlewares: [AuthMiddleware()],
),
];
// Usage in Controller
void logout() {
_authService.clear();
Get.offAllNamed(Routes.LOGIN);
}
// Route Guard
class AuthMiddleware extends GetMiddleware {
@override
RouteSettings? redirect(String? route) {
return isAuthenticated ? null : RouteSettings(name: Routes.LOGIN);
}
}
Navigator.of(context) when GetX is the primary router.Routes constant class for names.Get.dialog() and Get.snackbar() for consistency.For centralized route configuration and middleware guards: See references/app-pages.md and references/middleware-example.md.
getx-state-management | feature-based-clean-architecture
npx skills add ngxtm/Flutter GetX Navigation下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer