feat : login api call

This commit is contained in:
2025-05-17 15:24:06 +03:30
parent 0e630e709b
commit 303ff86d85
22 changed files with 518 additions and 522 deletions

View File

@@ -6,7 +6,8 @@ import 'package:rasadyar_core/core.dart';
class CaptchaWidgetLogic extends GetxController
with StateMixin<CaptchaResponseModel> {
TextEditingController textController = TextEditingController();
Rx<TextEditingController> textController = TextEditingController().obs;
RxnString captchaKey = RxnString();
GlobalKey<FormState> formKey = GlobalKey<FormState>();
AuthRepositoryImpl authRepository = diAuth.get<AuthRepositoryImpl>();
@@ -17,17 +18,19 @@ class CaptchaWidgetLogic extends GetxController
getCaptcha();
}
@override
void onClose() {
textController.value.dispose();
super.onClose();
}
Future<void> getCaptcha() async {
change(null, status: RxStatus.loading());
textController.value.clear();
safeCall(
call: () async => await authRepository.captcha(),
onSuccess: (value) {
captchaKey.value = value?.captchaKey;
change(value, status: RxStatus.success());
},
onError: (error, stackTrace) {