high priority low complexity integration pending integration specialist Tier 3

Acceptance Criteria

A clearly labeled share button (e.g., 'Del lenke' with share icon) is displayed on ReferralCodeScreen
Tapping the button invokes ShareSheetBridge (share_plus) with a pre-composed Norwegian message including the referral URL
The pre-composed message follows the format: 'Bli med som likeperson! Bruk min lenke: {referralUrl}'
The native iOS share sheet (UIActivityViewController) and Android intent chooser both open correctly
If the user dismisses the share sheet without sharing, no error or snackbar is shown — this is a valid non-action
If ShareSheetBridge throws a PlatformException, an error snackbar is shown with a user-friendly Norwegian message
The share button is disabled while the referral URL provider is loading or in error state
The share button meets 48x48dp minimum touch target and has a Semantics label for screen readers
Sharing content contains only the referral URL and pre-composed text — no personal data (name, contact info) is included per security requirements
Button is visually distinct from the copy button (primary action styling vs secondary)

Technical Requirements

frameworks
Flutter
Riverpod
share_plus
apis
ShareSheetBridge (share_plus Share.share)
ReferralCodeService (internal Riverpod provider)
data models
assignment
performance requirements
Share sheet opens within one tap — no loading delay beyond platform animation
security requirements
Shared content reviewed to ensure no PII is included — only referral URL and generic pre-composed text
Only aggregated/non-sensitive data included in share payload per share_plus security posture
ui components
ElevatedButton or FilledButton (primary share action)
Icon: share or ios_share from Material icons
SnackBar (error feedback)

Execution Context

Execution Tier
Tier 3

Tier 3 - 413 tasks

Can start after Tier 2 completes

Implementation Notes

Use `Share.share(text, subject: ...)` from share_plus. Wrap the call in a try/catch for `PlatformException`. The pre-composed message should be a localized string constant — define it in your l10n/arb files as `referralShareMessage` with a `{url}` placeholder. Do not pass any subject parameter on Android as it is not universally supported across apps.

Keep the share payload minimal: referral URL + text only. The share button should use the app's primary button style to signal it is the primary CTA on this screen.

Testing Requirements

Write widget tests using flutter_test. Mock ShareSheetBridge to verify it is called with the correct URL and message string. Test (1) share button triggers ShareSheetBridge.share with correct arguments, (2) PlatformException results in error SnackBar, (3) button is disabled when provider is loading, (4) button is disabled when provider is in error state. On physical devices (iOS + Android), verify the native share sheet opens and the pre-composed message appears.

Include TestFlight testing to confirm iOS share sheet behavior.

Component
Referral Code Screen
ui medium
Epic Risks (3)
medium impact medium prob technical

QR codes rendered at the minimum 200×200 size may fail to scan under typical indoor lighting conditions on older or lower-resolution phone cameras, causing recruitment moments to fail when a peer mentor shows the screen to a prospective member.

Mitigation & Contingency

Mitigation: Set the default QR render size to 260×260 logical pixels (not the 200px minimum) and apply a high-contrast white module background. Test scan reliability on at minimum three physical devices (budget Android, mid-range Android, iPhone SE) before marking the screen as done.

Contingency: If scan reliability remains an issue, add a 'Enlarge QR' full-screen mode triggered by tapping the code, and ensure the text referral URL with copy-to-clipboard is always visible as a fallback sharing method.

high impact medium prob integration

The onboarding screen submits attribution and then hands off to an external membership registration URL (HLF's Dynamics portal or similar). If the external URL is unavailable, changes its format, or requires authentication the new member does not have, the conversion funnel is broken at its final step.

Mitigation & Contingency

Mitigation: Confirm the external registration URL and its expected query parameters with HLF's portal team before implementing the handoff. Record the pending_signup attribution event before launching the URL so data is not lost if the external site fails. Display a fallback message with contact information if the URL launch fails.

Contingency: If the external membership URL is not available at feature launch, implement a temporary form that collects name and email and stores a pending_member record in Supabase, allowing coordinators to manually complete registration while the integration is finalised.

low impact medium prob integration

Embedding the RecruitmentStatsWidget on the peer mentor home screen may conflict with existing layout components (activity summary, badge shelf), causing overflow or requiring a redesign of the home screen that is outside this epic's scope.

Mitigation & Contingency

Mitigation: Design the widget as a horizontally constrained card with a maximum height of 96dp so it can be inserted into any vertical list without overflow. Coordinate with the home screen's existing layout owners before starting the embedding task.

Contingency: If home screen embedding creates unacceptable layout conflicts, defer embedding to a separate home-screen redesign task and make the widget accessible only via the dedicated ReferralCodeScreen for the initial release.