Share Sheet Bridge
Component Detail
Description
Wraps the Flutter Share plugin (share_plus) to invoke the native iOS and Android system share sheet. Packages the referral URL and an optional human-readable message for sharing via any installed app.
share-sheet-bridge
Summaries
The Share Sheet Bridge removes every barrier between a mentor's intention to recruit and the act of sharing, by handing off to the device's native sharing interface with a single tap. This means mentors can distribute their referral link through WhatsApp, SMS, email, AirDrop, or any other app already installed on their phone — without the platform needing to integrate with each channel individually. This zero-friction sharing capability multiplies the reach of the referral program at no additional integration cost, directly amplifying membership growth. It also ensures the experience feels native and trusted, rather than introducing an unfamiliar in-app sharing flow that mentors might abandon.
This low-complexity shared component wraps the share_plus Flutter plugin, which has broad platform support and a stable API, making it a low-risk delivery item. Because it is marked as shared, it must be delivered and stabilised before any feature team that includes sharing functionality can complete end-to-end testing. The main delivery consideration is verifying share_plus behaviour across the target iOS and Android OS versions in the test matrix, particularly around QR image attachment sharing, which uses a file-based approach on some platforms. Acceptance criteria should include both URL-only sharing and image attachment sharing tested on physical devices, as share sheet behaviour differs between simulators and real hardware.
Share Sheet Bridge wraps share_plus's Share.share() and Share.shareXFiles() APIs behind a stable internal interface, preventing feature widgets from depending directly on the package. shareReferralLink invokes Share.share(url, subject: message) with platform-appropriate subject line handling. shareQrCodeImage writes imageBytes to a temporary file via path_provider before calling Share.shareXFiles() — ensure the temp file is cleaned up in the onShareResult callback regardless of the outcome. buildDefaultShareMessage is a pure string composition function and should be unit tested with localised mentor name and org name inputs.
The onShareResult callback receives ShareResult from share_plus, which provides activityType on iOS but is always generic on Android; document this platform asymmetry for feature developers consuming the bridge.
Responsibilities
- Invoke system share sheet with referral URL payload
- Compose default share message text combining mentor name and referral link
- Handle share result callbacks (completed, dismissed)
- Support sharing QR code image as an attachment
Interfaces
shareReferralLink(url, message)
shareQrCodeImage(imageBytes, message)
onShareResult(result)
buildDefaultShareMessage(mentorName, orgName, url)
Relationships
Used Integrations (1)
External integrations and APIs this component relies on