From efddcc0ae5e3bb88c35ae0368f908ff86c4be673 Mon Sep 17 00:00:00 2001 From: dab246 Date: Thu, 20 Jul 2023 15:59:32 +0700 Subject: [PATCH] TF-2046 Add delay time for a while for GetX to delete the controller instance of the previous page (cherry picked from commit 466784af57d5c6be7b205e4b76e94a2ffa8f8347) --- lib/features/base/base_controller.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/features/base/base_controller.dart b/lib/features/base/base_controller.dart index 4c70790a2..6ca202abc 100644 --- a/lib/features/base/base_controller.dart +++ b/lib/features/base/base_controller.dart @@ -279,8 +279,13 @@ abstract class BaseController extends GetxController bool _isFcmActivated(Session session, AccountId accountId) => [FirebaseCapability.fcmIdentifier].isSupported(session, accountId) && AppConfig.fcmAvailable; - void goToLogin({LoginArguments? arguments}) { - pushAndPopAll(AppRoutes.login, arguments: arguments); + void goToLogin({LoginArguments? arguments}) async { + await Future.delayed( + const Duration(milliseconds: 500), + () async { + await pushAndPopAll(AppRoutes.login, arguments: arguments); + } + ); } void logout(Session? session, AccountId? accountId) {