arch-atlas

ProfileSetupController

profile_setup/presentation/providers/controller.dart

domain

Overview

Legacy StateNotifier driving the post-registration profile setup wizard. Holds role choice, personal info, address, freelancer-only fields (diploma, specialties, mobility, working hours), pageIndex, and isLoading/error.

User Flow

  1. Page-level widgets call setFirstName / setSex / setAddress / setSpecialties etc.
  2. nextPage / previousPage walk through the pages in order (role → info → client/prestataire → confirm).
  3. On final submit, the controller posts the assembled state to /store/customers/me + uploads diploma file (seller path).
  4. On success: mark profile_setup_complete in AuthStorage, refresh authState, navigate to /home.

Cases & Edge Cases

  • Diploma file upload is gated by role==freelancer — clients skip the field entirely.
  • Page index increments are unbounded — the controller assumes the calling screen knows the page count.
  • isLoading flag is a single boolean — concurrent operations clobber each other (e.g., file upload + form submit).

Code References

  • lib/src/features/shared/profile_setup/presentation/providers/controller.dart:12 // ProfileSetupController
  • lib/src/features/shared/profile_setup/presentation/providers/state.dart
  • lib/src/features/shared/profile_setup/presentation/providers/provider.dart

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

This wizard predates the newer onboarding_register / onboarding_register_seller wizards (see app_router.dart). It is still routed via /profile-setup but no longer the default landing for new users.