Technical Documentation: Notification Analytics
Architecture
Managed as a standalone analytics dashboard that consumes processed time-series and categorical data from the NotificationService. It uses the fl_chart library for performant rendering on the Flutter UI thread.


Technical Details
- File Path: lib/screens/notification_analytics_screen.dart
- Data Integration: Fetches up to 500 records via NotificationService.list() for local aggregation.
- Library: fl_chart (Pie/Bar/Line charts).


Analytics Logic
- KPI Calculation: _typeCounts getter iterates through the notification list to generate a frequency map.
- Timeline Grouping: Groups notifications by date string (YYYY-MM-DD), allowing for categorical stacking in bar charts.
- Severity Mapping: Defines a global _typeColors and _typeGradients map to ensure visual consistency.
Performance Optimization
- Memoization: Computed getters are recalculated only when the underlying notification list changes.
- Rendering Boundaries: Uses RepaintBoundary around individual chart widgets to isolate their paint cycles.