fix : injection and base page

This commit is contained in:
2025-09-27 13:52:54 +03:30
parent 0a98c57d75
commit be83996a02
5 changed files with 48 additions and 25 deletions

View File

@@ -53,13 +53,11 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
@override
void onInit() {
super.onInit();
fLog(Get.arguments.toString());
_textAnimationController =
AnimationController(vsync: this, duration: const Duration(milliseconds: 1200))
..repeat(reverse: true, count: 2).whenComplete(() {
showCard.value = true;
});
AnimationController(vsync: this, duration: const Duration(milliseconds: 1200))
..repeat(reverse: true, count: 2).whenComplete(() {
showCard.value = true;
});
textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut);
@@ -107,13 +105,12 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
AuthRepository authTmp = diChicken.get<AuthRepository>();
isLoading.value = true;
await safeCall<UserProfileModel?>(
call: () =>
authTmp.login(
authRequest: {
"username": usernameController.value.text,
"password": passwordController.value.text,
},
),
call: () => authTmp.login(
authRequest: {
"username": usernameController.value.text,
"password": passwordController.value.text,
},
),
onSuccess: (result) async {
await gService.saveSelectedModule(_module);
await tokenStorageService.saveModule(_module);
@@ -136,11 +133,14 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
} else {
Get.offAllNamed(ChickenRoutes.initSteward);
}
},
onError: (error, stackTrace) {
if (error is DioException) {
diChicken.get<DioErrorHandler>().handle(error);
if ((error.type == DioExceptionType.unknown) ||
(error.type == DioExceptionType.connectionError)) {
getUserInfo(usernameController.value.text);
}
}
captchaController.getCaptcha();
},
@@ -155,6 +155,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
onSuccess: (result) async {
if (result != null) {
await newSetupAuthDI(result.backend ?? '');
await diChicken.allReady();
}
},
onError: (error, stackTrace) {

View File

@@ -26,7 +26,7 @@ class AuthPage extends GetView<AuthLogic> {
),
vecPath: Assets.vec.chickenPatternSvg.path,
),
onPopScopTaped: () => Get.back(result: "HHHHHHHHEloo"),
onPopScopTaped: () => Get.back(result: -1),
child: Stack(
children: [
Center(