Flutter UI Walkthrough — Phone Signup
What the shopper sees
A phone-number input (pre-filled +91 country code), a consent checkbox referencing Terms & Conditions and the Privacy Policy with a tappable “Read Terms & Policies” link, a “Continue” button, and a link to switch to the login screen instead.
What the shopper does here
- Enters their phone number.
- Optionally opens the policy viewer to read the Terms, Privacy, and Returns documents before deciding.
- Checks the consent box.
- Taps “Continue” to receive an OTP code.
How it’s built
PhoneSignupController.onPhoneChanged(unmaskedDigits) builds _phoneNumber as '+91$unmaskedDigits' — the country code is hardcoded, not selectable. consentAccepted and isSubmitting are both .obs; toggleConsent(value) flips the former.
onInit() calls PolicyService.loadPolicies() — a fetch-once, cache-if-successful call shared with the policy viewer (PolicyService is this feature’s one deliberate exception to the “no Service layer” rule, since both this controller and PolicyViewerController need the same policy data for different reasons: this one for consent-stamping, the viewer for full content). onReadPolicies() navigates to AppRoutes.policyViewer.
onContinue() guards on !consentAccepted.value || isSubmitting.value, then calls IPhoneAuthRepository.sendSignupOtp(_phoneNumber). Server-side, AuthService::send_signup_otp rejects with a conflict (409) before generating any code if the phone number already has an account — the screen surfaces whatever error message the repository maps from that response. On success, the controller reads PolicyService.currentPolicy.value and navigates to the OTP-verify screen with {phone, mode: 'signup', termsAccepted: true, termsVersion: policy?.termsVersion ?? 'v1', privacyVersion: policy?.privacyVersion ?? 'v1'} — the hardcoded 'v1' constants are a fallback used only if the policy fetch itself failed, not the default path.

Related Documents
- user-secure-engine
- Architecture — Mobile Login & Signup: Component Topology and Data Flow
- ADR-00041
- Reference: Tenant Master — Step 5: Terms & Conditions — where the tenant admin authors and versions this document
- Reference: Tenant Master — Step 6: Privacy Policy — where the tenant admin authors and versions this document
- Previous: Splash
- Next: Policy Viewer
- Next: OTP Verify