Auth Controller
presentation · GetxController
Overview
GetxController that screens bind to. Holds the reactive Rx<User?> session, exposes async actions (login, register, logout, reset) and surfaces loading + error state for the UI.
User Flow
- Screens call controller.login(email, pw) on form submit.
- Controller flips isBusy=true, runs the use case, waits for Either.
- On Left → fold to snackbar with AuthFailure.message.
- On Right → assign user.value, persist via repository, navigate via routes.
Cases & Edge Cases
- Double-submit guard: ignore taps while isBusy=true.
- Reset busy state inside finally so a thrown error never leaves the button spinning.
- On boot: read cached session and pre-populate user.value before the first frame.
Code References
- lib/features/auth/presentation/controllers/auth_controller.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
The only place GetX (Rx, Get.snackbar, Get.offAll) is allowed to leak in. Keep use cases and repos GetX-free.