Fix TextEditingController was used after being disposed in LoginView

(cherry picked from commit 16d0c8b5db6e5829836a87afb66769698236c837)
This commit is contained in:
dab246
2023-08-28 18:34:16 +07:00
committed by Dat Vu
parent a26d2e60a0
commit 20c9777819
2 changed files with 5 additions and 8 deletions
+4 -7
View File
@@ -279,13 +279,10 @@ abstract class BaseController extends GetxController
bool _isFcmActivated(Session session, AccountId accountId) => bool _isFcmActivated(Session session, AccountId accountId) =>
[FirebaseCapability.fcmIdentifier].isSupported(session, accountId) && AppConfig.fcmAvailable; [FirebaseCapability.fcmIdentifier].isSupported(session, accountId) && AppConfig.fcmAvailable;
void goToLogin({LoginArguments? arguments}) async { void goToLogin({LoginArguments? arguments}) {
await Future.delayed( if (Get.currentRoute != AppRoutes.login) {
const Duration(milliseconds: 500), pushAndPopAll(AppRoutes.login, arguments: arguments);
() async { }
await pushAndPopAll(AppRoutes.login, arguments: arguments);
}
);
} }
void logout(Session? session, AccountId? accountId) { void logout(Session? session, AccountId? accountId) {
@@ -54,7 +54,7 @@ class LoginBindings extends BaseBindings {
@override @override
void bindingsController() { void bindingsController() {
Get.lazyPut(() => LoginController( Get.create(() => LoginController(
Get.find<GetAuthenticatedAccountInteractor>(), Get.find<GetAuthenticatedAccountInteractor>(),
Get.find<UpdateAuthenticationAccountInteractor>(), Get.find<UpdateAuthenticationAccountInteractor>(),
Get.find<AuthenticationInteractor>(), Get.find<AuthenticationInteractor>(),