Third Party Library Luke Freeman (open source) Outbound
Sdk
Connection
Outbound
Data Flow
4
Components
2
Dependencies

Description

qr_flutter generates QR codes for the peer mentor referral and recruitment feature, allowing peer mentors to share unique referral codes via a scannable QR code. New members scanning the QR code are attributed to the referring mentor for gamification badge criteria and recruitment statistics tracking, supporting HLF's membership growth objective.

Detailed Analysis

qr_flutter is a free BSD-licensed Flutter package that enables the peer mentor referral and recruitment feature — a direct contributor to HLF's membership growth objective. Peer mentors generate a unique scannable QR code embedding their referral code; new members who scan it are automatically attributed to the referring mentor, feeding gamification badge criteria and recruitment statistics visible on the 564-coordinator-recruitment-dashboard. This creates a measurable, low-friction recruitment loop that incentivises existing members to grow the organisation. Because QR code generation is entirely device-local with no external service dependency, there is zero incremental cost per code generated and no vendor risk.

The referral code itself is non-sensitive and safe to encode without encryption, simplifying the security posture of the feature.

qr_flutter (>=4.1.0) is a lightweight dependency with minimal setup — no API keys, no platform permissions, and no external service onboarding required. Four components depend on it: 570-qr-code-generator, 561-referral-code-screen, 562-recruitment-stats-widget, and 564-coordinator-recruitment-dashboard. The primary delivery dependency is the Supabase-side referral code generation and storage logic, which must be implemented before QR rendering can be meaningfully tested end-to-end. The QR code data URL format (including referral code structure) must be agreed upon early to avoid rework in both the mobile app and the backend attribution logic.

Optional branding configuration (embedded organisation logo, colour matching design tokens) should be scoped as a polish task after functional delivery. The plain-text referral code fallback and copy-to-clipboard button are low-effort safety nets that should be included in the initial delivery. Monitoring targets include QR share rate and referral conversion rate for post-launch programme effectiveness reporting.

qr_flutter (^4.1.0) renders QR codes synchronously as Flutter widgets with a target render time of < 100ms — no async operations, no network calls, no authentication. The QR code data string is a URL embedding the referral code generated and stored in Supabase; the 570-qr-code-generator component constructs this URL and passes it to the QrImageView widget. Configurable options include size, error correction level (L/M/Q/H), embedded centre logo image, and colour overrides for design token alignment. The data URL is validated on scan to prevent injection attacks — referral codes should follow a strict alphanumeric format enforced at generation time in the database layer.

Error handling is minimal: QR generation failures (e.g., invalid data string) display the raw referral code as plain text, and a copy-to-clipboard button provides an alternative sharing method. No environment variables or build-time configuration are required. Dart SDK and Flutter version constraints must satisfy >=4.1.0 for the package.

Dependencies (2)

qr_flutter Flutter package >=4.1.0 External
Referral code generated and stored in Supabase database External

Authentication

TypeNone

Configuration

Required Settings

QR code data URL format including referral code Required

Optional Settings

QR code size and error correction level Optional
Embedded organisation logo in QR code center Optional
QR code colour matching organisation design tokens Optional

Error Handling

QR generation failure shows referral code as plain text as fallback

Monitoring

Metrics

QR code share rate
Referral conversion rate

Performance

Latency< 100ms for QR code render
AvailabilityDevice-local rendering — no network dependency

Cost Implications

Pricing ModelFree open-source (BSD licence)

Security Considerations

Referral codes are non-sensitive — safe to encode in QR without encryption
QR code data URL validated on scan to prevent injection

Fallback Mechanisms

Plain text referral code displayed when QR rendering fails
Copy-to-clipboard button as alternative sharing method