flutter-navigation
Installation
SKILL.md
When to Use
- Adding a new route/screen
- Protecting routes behind authentication
- Setting up bottom navigation with shell routes
- Implementing deep links
- Passing parameters between screens
Router Setup
Full GoRouter configuration with public routes, auth redirect, and StatefulShellRoute for bottom navigation.
Example: See assets/app_router.dart
Auth Guard — Global Redirect
Redirect function that checks auth state and routes accordingly:
- Not authenticated + protected route →
/login?redirect=... - Authenticated + auth route →
/home(or stored redirect)