Register + OTP Screens
onboarding_register/presentation/pages
Overview
Two-step wizard pages: RegisterStepPage collects email + password and triggers registerNotifier; OtpStepPage receives the email via route extra and verifies the 6-digit code, after which the session is finally persisted.
User Flow
- RegisterStepPage → registerNotifier.register(email, password).
- On success, wizard pushes OtpStepPage with state.extra = {email}.
- OtpStepPage submits the code → AuthApiService.verify → AuthStorageService.saveSessionOtp persists the token.
- GoRouter redirect bounces to /onboarding_register (or /onboarding_register_seller for pending sellers).
Cases & Edge Cases
- Hot-reload of OtpStepPage with no route extra crashes — defensive cast is intentional, dev-only failure.
- Re-sending the OTP is rate-limited server-side; UI cools down the button for ~30s without consulting the backend.
- If the user backgrounds the app between register and OTP, the partially-saved pendingRegistrationData (in AuthStorageService) keeps the wizard resumable.
Code References
- lib/src/features/shared/onboarding_register/presentation/pages/register_step_page.dart
- lib/src/features/shared/onboarding_register/presentation/pages/otp_step_page.dart
- lib/src/features/shared/onboarding_register/presentation/onboarding_register_wizard.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
The /register and /otp routes both point into the onboarding-register wizard rather than the legacy auth/register/register.dart screen, which is kept around but unrouted.