arch-atlas

Home Grid (FirstPage / SecondPage)

presentation/widgets/{first,second}_page.dart

presentation

Overview

Two 4×4 grids of HomeGridItem tiles. FirstPage._prestatireItems and _clientItems are two parallel static lists picked at runtime based on userRoleProvider. Each tile carries a routePath, image asset, requiresLogin flag and optional rolesAllowed filter.

User Flow

  1. FirstPage.build reads userRoleProvider and picks the matching item list.
  2. Each HomeGridItem renders the asset (light/dark variant) + label + 'NEW' badge.
  3. Tapping a tile checks requiresLogin against the current auth state, then context.push(routePath).
  4. Items with routePath like '/urgent' / '/concours' point at not-yet-implemented routes — they render but navigate to a 404-style stub.

Cases & Edge Cases

  • imageDark fallback to image when the dark variant is absent — handled by HomeGridItem.
  • isNewFeature controls a small 'NEW' chip; never auto-cleared, must be manually set false on each new build.
  • Several routes (/urgent, /domicile, /event, /before-after, /formations, /finances, /concours) are placeholders — the team uses them as visible TODOs.

Code References

  • lib/src/features/shared/home/presentation/widgets/first_page.dart:13 // _prestatireItems
  • lib/src/features/shared/home/presentation/widgets/first_page.dart:37 // _clientItems
  • lib/src/features/shared/home/presentation/widgets/second_page.dart
  • lib/src/features/shared/home/presentation/widgets/home_grid_item.dart

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

Item lists are static const-ish but use HomeGridItemData (not const due to AppRoute getters); refactoring AppRoute.path to a const string would let the whole list be const.