From ddac155a6a256152910a96d756578421a2a366fa Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Sun, 30 Nov 2025 11:11:32 +0300 Subject: [PATCH] silent login case handled. --- lib/core/api_consts.dart | 2 +- lib/features/authentication/authentication_repo.dart | 6 ++++++ lib/presentation/e_referral/new_e_referral.dart | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 2be40d0..3ae8d4c 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -710,7 +710,7 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT diff --git a/lib/features/authentication/authentication_repo.dart b/lib/features/authentication/authentication_repo.dart index d566996..6ecf4b1 100644 --- a/lib/features/authentication/authentication_repo.dart +++ b/lib/features/authentication/authentication_repo.dart @@ -265,6 +265,12 @@ class AuthenticationRepoImp implements AuthenticationRepo { newRequest.isDentalAllowedBackend = false; newRequest.forRegisteration = newRequest.isRegister ?? false; newRequest.isRegister = false; + //silent login case removed token and login token + if(newRequest.logInTokenID.isEmpty && newRequest.isSilentLogin == true) { + newRequest.logInTokenID = null; + newRequest.deviceToken = null; + } + } Map familyRequest = {}; diff --git a/lib/presentation/e_referral/new_e_referral.dart b/lib/presentation/e_referral/new_e_referral.dart index c736216..b28b8df 100644 --- a/lib/presentation/e_referral/new_e_referral.dart +++ b/lib/presentation/e_referral/new_e_referral.dart @@ -47,7 +47,9 @@ class _NewReferralPageState extends State { @override void initState() { super.initState(); - _loadData(); + WidgetsBinding.instance.addPostFrameCallback((_) { + _loadData(); + }); } void _handleNextStep() { @@ -144,6 +146,9 @@ class _NewReferralPageState extends State { } void _loadData() { + + + final authVM = context.read(); final habibWalletVM = context.read(); final hmgServicesVM = context.read();