Summary Share Service
Component Detail
Description
Orchestrates the sharing workflow for the annual summary. Coordinates with the screenshot capture utility to render an off-screen widget to an image, then routes the result to the chosen share channel (clipboard, gallery, system share). Handles permission checks and platform-specific differences between iOS and Android.
summary-share-service
Summaries
The Summary Share Service enables peer mentors to share their annual impact story across social channels, galleries, and messaging platforms with a single tap — turning a private achievement into organic, word-of-mouth promotion for the platform at zero additional marketing cost. Each share event extends the platform's brand reach and positions mentors as credible, celebrated contributors within their professional and social networks. The service handles the complexity of iOS and Android permission models and platform-specific share mechanics silently, so mentors experience a frictionless, delightful sharing moment rather than a confusing permissions workflow. Privacy is maintained by design: analytics logging captures share events without retaining image content or personal data, satisfying data protection obligations while still providing engagement metrics to the product team.
The Summary Share Service has medium complexity driven primarily by platform divergence between iOS and Android permission models and share sheet APIs. The team must allocate dedicated QA time across both platforms, including permission-denied, permission-granted, and permission-revoked scenarios. A dependency on the screenshot-capture-utility means that component must be stable before share integration testing can begin — sequence this in the sprint plan accordingly. Gallery save functionality requires photo library permission handling that may vary across OS versions; target at minimum iOS 14+ and Android 10+ and document any version-specific fallbacks.
Analytics integration should be validated to confirm no PII leakage. Clipboard and system share sheet paths should each be tested independently, as they exercise different OS APIs and have distinct failure modes.
The Summary Share Service orchestrates a multi-step async pipeline: it calls the screenshot-capture-utility to render an off-screen Flutter widget to a Uint8List PNG buffer, then routes that buffer to one of three channels — clipboard via Clipboard.setData or a platform channel equivalent, gallery via the photo library permission flow and image_gallery_saver or similar package, or the native share sheet via share_plus. The shareCurrentSlide method is the primary entry point consumed by the BLoC layer and must return a ShareResult discriminated union covering success, permissionDenied, and error cases so the UI can display appropriate feedback. Platform differences (e.g., on iOS the share sheet inherently supports clipboard and gallery without separate permission prompts) should be abstracted behind a platform-detection strategy injected at construction time to keep the core logic testable. Ensure the captured Uint8List is not held in memory longer than needed to avoid OOM risk on lower-end devices.
Responsibilities
- Coordinate screenshot rendering for the active summary slide
- Request and validate photo library permissions before saving
- Route captured images to clipboard, gallery, or system share sheet
- Log sharing events for analytics without capturing personal data
Interfaces
shareCurrentSlide(slideWidget: Widget, channel: ShareChannel): Future<ShareResult>
captureSlideAsImage(slideWidget: Widget): Future<Uint8List>
requestGalleryPermission(): Future<bool>
copyToClipboard(image: Uint8List): Future<void>
openShareSheet(image: Uint8List, title: String): Future<void>
Relationships
Used Integrations (1)
External integrations and APIs this component relies on