07 — Component Library (Notifications Module)
- 1. Component Inventory
- 2. NotificationListTile Contract
- 3. NotificationBadge Contract
- 4. Reuse Notes
Authoritative shared components in 00-shared/03; this file lists the module's component set and which shared primitives each is composed of. All items are derived from the API contract in 12_API_Mapping.
1. Component Inventory
| # | Component | Purpose | Composed of (from 00-shared/03) | State |
|---|---|---|---|---|
| C1 | NotificationListTile | One inbox row | Card/ListTile, Avatar(icon), Text (title/body), relative-time Text, UnreadDot | ✅ |
| C2 | UnreadDot | 8 dp accent dot, unread only | custom Paint (no shared dep) | ✅ |
| C3 | NotificationBadge | Shell bell badge w/ count (0/n/99+) | Badge widget, IconButton(bell) | ✅ |
| C4 | InboxEmptyState | Empty/zero-unread illustration + copy | EmptyState (shared) | ✅ |
| C5 | MarkAllReadAction | AppBar text button, conditional visibility | TextButton | ✅ |
| C6 | PaginationFooter | Spinner / retry row at list end | CircularProgress, TextButton | ✅ |
| C7 | InboxErrorPanel | First-load error + Retry | ErrorPanel (shared) | ✅ |
| C8 | TypeIcon | Per-type leading icon mapping | Icon (mapped in 11 §3) | ✅ |
| C9 | FilterChip (unread) | unreadOnly toggle | FilterChip (shared) (proposed) | ⏳ |
| C10 | SwipeToMarkRead | Dismissible wrapper on C1 | Dismissible (proposed) | ⏳ |
2. NotificationListTile Contract
NotificationListTile({
required Notification n, // model from `15_Flutter_Implementation_Guide`
required VoidCallback onTap, // marks read (if unread) + optional nav
})
- Displays:
n.title,n.body(2-line), relativen.createdAt,C8icon,C2dot iffn.readAt == null. - Unread style:
titleMediumbold + tinted surface; read:titleMediumregular. - Semantics: unread suffix (see
06 §1.7).
3. NotificationBadge Contract
- Input:
int count(0 hides). - Behavior:
99+ceiling;m-fastscale on change; semantics label. - Data source:
UnreadCountCubit(13_State_Management), refreshed on foreground + inbox mutations.
4. Reuse Notes
- Do not invent new buttons/inputs — reuse shared
AppButton,AppTextFieldetc. from00-shared/03. - No new stateful primitive widgets: C1/C3 hold state via Cubits, not local
widget state (
00-shared/06).