Flutter Navigation
Priority: P1 (OPERATIONAL)
Navigation and routing for Flutter apps using go_router or named routes.
Guidelines
- •Package: Use
go_routerfor modern, declarative routing. - •Deep Linking: Configure
AndroidManifest.xmlandInfo.plistfor URL schemes. - •Validation: Validate parameters in
redirectlogic before navigation. - •Stateful Tabs: Use
IndexedStackto preserve state in bottom navigation.
Anti-Patterns
- •No Manual URL Parsing: Use
go_routerparsing, neverUri.parsemanually. - •No Stateless Tabs:
Scaffoldbody switching loses state; useIndexedStack. - •No Unvalidated Deep Links: Always check if IDs exist in
redirect. - •No Hardcoded Routes: Use constants (e.g.,
Routes.home) or code generation.
Related Topics
flutter-design-system | flutter-notifications | mobile-ux-core