docs: Update mobile development guidelines to enforce safe navigation and typed navigators with fallback mechanisms.
This commit is contained in:
@@ -42,9 +42,10 @@ Follow Dart standards strictly.
|
||||
* **Data Transformation**: MUST reside in **Repositories** (Data Connect layer).
|
||||
* *Forbidden*: Parsing JSON in the UI or Domain.
|
||||
* **Pattern**: Repositories map Data Connect models to Domain entities.
|
||||
* **Navigation Logic**: MUST reside in **Flutter Modular Routes**.
|
||||
* *Forbidden*: `Navigator.push` with hardcoded widgets.
|
||||
* **Pattern**: Use named routes via `Modular.to.navigate()`.
|
||||
* **Navigation Logic**: MUST reside in **Flutter Modular Routes** and use **Safe Navigation**.
|
||||
* *Forbidden*: `Navigator.push` with hardcoded widgets or direct `Modular.to.pop()` / `Modular.to.navigate()`.
|
||||
* **Pattern**: Use `popSafe()`, `safeNavigate()`, `safePush()`, etc., from `NavigationExtensions`. Prefer **Typed Navigators** (e.g., `Modular.to.toHome()`).
|
||||
* **Fallback**: All navigation MUST have a fallback to the Home page implemented in `NavigationExtensions`.
|
||||
* **Session Management**: MUST reside in **DataConnectService** via **SessionHandlerMixin**.
|
||||
* **Pattern**: Automatic token refresh, auth state listening, and role-based validation.
|
||||
* **UI Reaction**: **SessionListener** widget wraps the entire app and responds to session state changes.
|
||||
|
||||
Reference in New Issue
Block a user