Implement shareable image card preview in share overlay
epic-annual-impact-summary-ui-components-task-014 — Integrate with ScreenshotCaptureUtility to render a live preview of the shareable image card inside the SummaryShareOverlay. The preview must update when the overlay opens and reflect the current stat card and milestone data. Implement the share action handler that invokes the native share sheet with the captured image.
Acceptance Criteria
Technical Requirements
Execution Context
Tier 2 - 518 tasks
Can start after Tier 1 completes
Implementation Notes
Use a GlobalKey
Ensure the RepaintBoundary is part of the overlay's own subtree, not the background page, to avoid capturing unintended UI. For the loading state, set the share button's onPressed to null and show a CircularProgressIndicator inside it rather than replacing the button widget to avoid layout shift.
Testing Requirements
Write Flutter widget tests (flutter_test) for: (1) overlay opens and preview renders without throwing; (2) share button is disabled during capture and re-enabled after; (3) share button triggers the share action handler (mock share_plus); (4) error path shows snackbar when capture throws; (5) overlay dismisses cleanly. Also write a manual smoke-test checklist for TestFlight covering both iOS share sheet and Android intent chooser. Target 80% line coverage on the overlay widget file.
Simultaneous count-up animations across multiple stat cards and chart draw-in animations on lower-end Android devices may cause frame drops below 60fps, degrading the premium Wrapped experience and making the feature feel unpolished.
Mitigation & Contingency
Mitigation: Stagger animation starts using AnimationController with staggered intervals rather than starting all animations simultaneously. Use RepaintBoundary around each animated widget to isolate rasterisation. Profile on a mid-range Android device (e.g., equivalent to Pixel 4a) during development, not just at QA.
Contingency: If frame rate targets cannot be met on low-end devices, implement a device-capability check at startup and substitute simpler fade-in animations for the count-up and chart draw-in on devices below a CPU performance threshold.
The activity-type-breakdown-widget must render organisation-specific activity type labels sourced from the terminology system. If the terminology provider is not yet integrated at the time this widget is built, the widget will display hardcoded system labels, which is a regression risk for multi-org support.
Mitigation & Contingency
Mitigation: Accept activity type labels as a typed parameter in the widget constructor rather than reading from the terminology provider directly inside the widget. The BLoC or repository layer resolves labels before passing them to the widget, maintaining clean separation and testability.
Contingency: If terminology resolution is unavailable at widget integration time, display internal activity type keys as a temporary fallback with a localised suffix '(label pending)' visible only in non-production builds so QA can identify unresolved labels.