Flutter UI Walkthrough — Profile Details
What the shopper sees
A routed screen with an avatar at the top (tap to change), editable Name and Date of Birth fields, a Gender dropdown, and two read-only rows for Phone and Email — each showing a verification-status pill (“Verified”/“Action Needed”) and an always-visible “Change” button. A “Save” action commits name/DOB/gender together.
What the shopper does here
- Taps the avatar to pick/capture a photo, crop it to a square, and upload it.
- Edits Name and/or Date of Birth, or selects a Gender option, then taps Save.
- Taps “Change” next to Phone or Email to open the two-step OTP change sheet.
How it’s built
ProfileView is a StatefulWidget (not stateless) — local TextEditingControllers for name and DOB are seeded once from the loaded ProfileModel, since a text field needs an editable local buffer rather than rebuilding from reactive state on every keystroke. Phone and email, by contrast, are never backed by a TextEditingController — they’re rendered directly from profile.phone/profile.email and only ever change via the decoupled OTP flow below, never via this screen’s own Save button. DOB uses the shared AppDateField (DD/MM/YYYY format); Gender uses AppDropdownField with a fixed option set (_kGenderOptions), defaulting to “Prefer not to say.”
Standard fields save — Save calls ProfileRepository’s profile-update endpoint on user-secure-engine, carrying only full_name/dob/gender — phone and email are structurally absent from this request type, by design (see ADR-00040).
Avatar upload — pick/capture → 1:1 crop (image_cropper) → MediaService requests a presigned upload URL from media-access-service → the cropped image is PUT to that URL → content-processor’s shared image pipeline resizes/encodes it asynchronously → the screen bounded-polls (_pollForProcessedAvatar(), 5 attempts, 2 seconds apart) until the profile’s avatarUrl changes, then resolves it to a displayable URL via mediaService.resolveDownloadUrls. The transactionId sent with the upload is the shopper’s Firebase user id (not the tenant id) — user-secure-engine’s avatar Pub/Sub receiver matches on that same id server-side.
Phone/email change — tapping “Change” opens ChangeContactSheet, a decoupled two-step OTP-commit flow (not part of the standard Save above): step 1 is a validated text field prefilled with the current value; step 2 is a code field with a 60-second resend cooldown. On successful verification, the new value commits immediately server-side — there’s no separate save step, and the app holds no intermediate “pending change” state. ProfileController.verifyOtp then re-fetches the full profile (not an optimistic patch) so the verification badge reflects the committed value. A phone change additionally triggers a forced-logout dialog, since Firebase Auth identity is keyed off phone number; an email change does not. See the dedicated Change Contact walkthrough is not a separate page in this listing — the flow is covered here and in TD-00020 where relevant.
The three screenshots below cover, in order: the main Profile Details view, the email-change step-1 sheet, and the email-change step-2 OTP sheet.



