From 0608fd988baa5adc734a278c5f8a17320e97cc74 Mon Sep 17 00:00:00 2001 From: FaizHashmi Date: Wed, 7 Oct 2026 10:39:59 +0300 Subject: [PATCH] navigation change --- assets/langs/ar-SA.json | 3 +-- assets/langs/en-US.json | 3 +-- lib/core/app_state.dart | 21 +++++++++++---------- lib/splashPage.dart | 36 ++++++++++++++++-------------------- 4 files changed, 29 insertions(+), 34 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index d5167430..e8eb5a1f 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -2090,8 +2090,7 @@ "resetEnvConfirm": "هل أنت متأكد من إعادة إعدادات البيئة إلى الافتراضي؟", "envResetSuccess": "تمت إعادة ضبط البيئة بنجاح", "envUpdateSuccess": "تم تحديث البيئة بنجاح", - "envUpdateFailed": "فشل تحديث البيئة" - "liveCareTermsConditions48": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011", + "envUpdateFailed": "فشل تحديث البيئة", "importantNotice": "تنبيه هام", "appDecommissionedText": "تم إيقاف هذا الإصدار من تطبيق الحبيب الطبي.\nللاستمرار في الاستفادة من الخدمات الصحية والسجلات الطبية، يرجى تحميل التطبيق الجديد.", "appDecommissionedSubText": "نعتذر بشدة عن الإزعاج الناتج عن هذا الانتقال.", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index c6c23d3d..a20d8993 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -2080,8 +2080,7 @@ "resetEnvConfirm": "Are you sure you want to reset environment settings to default?", "envResetSuccess": "Environment reset successfully", "envUpdateSuccess": "Environment updated successfully", - "envUpdateFailed": "Failed to update environment" - "liveCareTermsConditions48": "If you have any complaints or concerns about the Application and or the Website, Our Services, or how we handle your personal information please contact us on: EServices.HMG@drsulaimanalhabib.com or call 011 525 9553", + "envUpdateFailed": "Failed to update environment", "importantNotice": "Important Notice", "appDecommissionedText": "This version of our healthcare application has been officially discontinued. To ensure uninterrupted access to your clinical records, we are transitioning all patients back to our main platform.", "appDecommissionedSubText": "We sincerely apologize for the inconvenience of this transition.", diff --git a/lib/core/app_state.dart b/lib/core/app_state.dart index c420a0c3..6926e8ab 100644 --- a/lib/core/app_state.dart +++ b/lib/core/app_state.dart @@ -20,7 +20,7 @@ class AppState { static const String _profileImageKey = 'profile_image_data'; - AppState({required this.navigationService, required this.cacheService}){ + AppState({required this.navigationService, required this.cacheService}) { checkIfGMSAvailableOrNot(); _loadProfileImageFromCache(); } @@ -49,6 +49,7 @@ class AppState { bool isPaytabsEnabled = false; bool isPayfortHostedPageEnabled = true; bool isMyFatoorahEnabled = false; + // bool isMyFatoorahEnabled = true; void setIsPaytabsEnabled(bool value) { @@ -70,7 +71,8 @@ class AppState { bool isChildLoggedIn = false; bool isGMSAvailable = true; bool isAndroid = true; - bool isRatedVisible =false; + bool isRatedVisible = false; + void setAuthenticatedUser(AuthenticatedUser? authenticatedUser, {bool isFamily = false}) { if (isFamily) { _authenticatedChildUser = authenticatedUser; @@ -82,10 +84,10 @@ class AppState { FutureOr checkIfGMSAvailableOrNot() async { isGMSAvailable = (await GmsCheck().checkGmsAvailability()) ?? true; - if(Platform.isIOS) { - isGMSAvailable = true; - isAndroid = false; - return; + if (Platform.isIOS) { + isGMSAvailable = true; + isAndroid = false; + return; } } @@ -240,7 +242,7 @@ class AppState { userLat = 0.0; } - setRatedVisible(bool value) { + setRatedVisible(bool value) { isRatedVisible = value; } @@ -295,7 +297,6 @@ class AppState { } } - dynamic getUserSwitchPayload({required String userType}) { return _userSwitchPayloads[userType]; } @@ -321,11 +322,11 @@ class AppState { void clearChildUsersKeepSuperUser() { // Keep the super user payload final superUserPayload = _userSwitchPayloads['superUser']; - + // Clear all payloads _userSwitchPayloads.clear(); _childSwitchCounter = 0; - + // Restore super user if it existed if (superUserPayload != null) { _userSwitchPayloads['superUser'] = superUserPayload; diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 8ebe655e..be8b7c2f 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -93,18 +93,18 @@ class _SplashScreenState extends State { if (isAppOpenedFromCall) { navigateToTeleConsult(); } else { - if (Utils.havePrivilege(124)) { - Navigator.of(getIt.get().navigatorKey.currentContext!).pushAndRemoveUntil(CustomPageRoute(page: AppClosedPage()), (r) => false); + // if (Utils.havePrivilege(124)) { + // Navigator.of(getIt.get().navigatorKey.currentContext!).pushAndRemoveUntil(CustomPageRoute(page: AppClosedPage()), (r) => false); + // } else { + if (await Utils.getBoolFromPrefs(CacheConst.firstLaunch)) { + // Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen()))); + Navigator.of(getIt.get().navigatorKey.currentContext!).pushReplacement(FadePage(page: OnboardingScreen())); } else { - if (await Utils.getBoolFromPrefs(CacheConst.firstLaunch)) { - // Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: OnboardingScreen()))); - Navigator.of(getIt.get().navigatorKey.currentContext!).pushReplacement(FadePage(page: OnboardingScreen())); - } else { - // Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); - Navigator.of(getIt.get().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation())); - } + // Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); + Navigator.of(getIt.get().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation())); } } + // } } }); @@ -127,24 +127,24 @@ class _SplashScreenState extends State { // Set initial app context tags try { final appState = getIt.get(); - + // Set device and app metadata Clarity.setCustomTag('app_version', ApiConsts.appVersionID.toString()); Clarity.setCustomTag('device_type', appState.deviceTypeID ?? 'unknown'); Clarity.setCustomTag('platform', Platform.isIOS ? 'ios' : 'android'); - + // Set user context if authenticated if (appState.isAuthenticated) { final user = appState.getAuthenticatedUser(); if (user != null) { // Set user ID for session tracking Clarity.setCustomUserId(user.patientId.toString()); - + // Set custom tags for filtering sessions Clarity.setCustomTag('user_type', user.patientType?.toString() ?? 'unknown'); Clarity.setCustomTag('user_segment', user.outSa == 0 ? 'in_sa' : 'out_sa'); Clarity.setCustomTag('auth_status', 'authenticated'); - + // Optional: Set other non-sensitive user properties if (user.mobileNumber != null) { // Mask phone number for privacy (show only last 4 digits) @@ -155,10 +155,9 @@ class _SplashScreenState extends State { } else { Clarity.setCustomTag('auth_status', 'guest'); } - + // Send initialization event Clarity.sendCustomEvent('app_initialized'); - } catch (e) { debugPrint('Failed to set Clarity user context: $e'); } @@ -171,8 +170,7 @@ class _SplashScreenState extends State { // GetIt.instance().remove(key: CacheConst.isAppOpenedFromCall); Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall); - Navigator.of(GetIt.instance().navigatorKey.currentContext!) - .pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); + Navigator.of(GetIt.instance().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); Navigator.pushReplacementNamed( // context, GetIt.instance().navigatorKey.currentContext!, @@ -392,8 +390,6 @@ class _SplashScreenState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.whiteColor, - body: Lottie.asset(AppAnimations.loadingAnimation, - repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill) - .center); + body: Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill).center); } }