skill-level: medior
status: done
Task: Integrate Consent Banner into Home View
End Goal
Home screen displays the notification consent banner when OS permission is undetermined, with full consent flow handling.
Currently
- Home view has expense card, cleaning schedule, shopping lists, roomies sections
- No notification consent banner
Should
- Banner visible only when
NotificationPermissionService.isUndetermined is true
- Banner placed prominently (above or below expense card)
- Tapping banner opens consent bottom sheet
- Accept flow:
- Request OS permission
- On grant: toast success, close sheet, hide banner
- On deny: toast denied, close sheet
- Cancel flow: close sheet, banner remains
- Analytics tracked at each step
Constraints
- [ ] Banner visibility reactive to permission status
- [ ] Use
HomeViewModel for state and actions
- [ ] Use
SheetService for bottom sheet
- [ ] Track all analytics events
Acceptance Criteria
- [ ] Banner appears only when permission undetermined
- [ ] Banner disappears after permission granted
- [ ] Banner remains after permission denied or cancel
- [ ] Consent flow works end-to-end
- [ ] Analytics events fire correctly
Implementation Checklist
- [x] 6.1 Add
NotificationPermissionService dependency to HomeViewModel
- [x] 6.2 Add
NotificationPermissionAnalytics to HomeViewModel
- [x] 6.3 Add
shouldShowNotificationBanner getter/informer
- [x] 6.4 Add
onNotificationBannerTapped() method
- [x] 6.5 Show consent sheet via
SheetService
- [x] 6.6 Implement
onConsentAccepted() - request permission, handle result
- [x] 6.7 Implement
onConsentCancelled() - close sheet, track analytics
- [x] 6.8 Add
NotificationConsentBanner to HomeView children list
- [x] 6.9 Wrap banner in
ValueListenableBuilder for reactivity
- [x] 6.10 Add toast messages for grant/deny outcomes
- [x] 6.11 Call
NotificationPreferencesService.updateOsPermissionGranted() on grant/deny
- [x] 6.12 Run
flutter analyze to verify no issues
Notes
- The banner should check permission status on view load and update reactively
- Consider using
Informer<bool> for banner visibility state
Reacties