navigation change

faiz_dev_tools_imp
FaizHashmi 3 weeks ago
parent d85adb297d
commit 0608fd988b

@ -2090,8 +2090,7 @@
"resetEnvConfirm": "هل أنت متأكد من إعادة إعدادات البيئة إلى الافتراضي؟",
"envResetSuccess": "تمت إعادة ضبط البيئة بنجاح",
"envUpdateSuccess": "تم تحديث البيئة بنجاح",
"envUpdateFailed": "فشل تحديث البيئة"
"liveCareTermsConditions48": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011",
"envUpdateFailed": "فشل تحديث البيئة",
"importantNotice": "تنبيه هام",
"appDecommissionedText": "تم إيقاف هذا الإصدار من تطبيق الحبيب الطبي.\nللاستمرار في الاستفادة من الخدمات الصحية والسجلات الطبية، يرجى تحميل التطبيق الجديد.",
"appDecommissionedSubText": "نعتذر بشدة عن الإزعاج الناتج عن هذا الانتقال.",

@ -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.",

@ -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<void> 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;

@ -93,18 +93,18 @@ class _SplashScreenState extends State<SplashPage> {
if (isAppOpenedFromCall) {
navigateToTeleConsult();
} else {
if (Utils.havePrivilege(124)) {
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushAndRemoveUntil(CustomPageRoute(page: AppClosedPage()), (r) => false);
// if (Utils.havePrivilege(124)) {
// Navigator.of(getIt.get<NavigationService>().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<NavigationService>().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<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: OnboardingScreen()));
} else {
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation()));
}
// Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation()));
}
}
// }
}
});
@ -127,24 +127,24 @@ class _SplashScreenState extends State<SplashPage> {
// Set initial app context tags
try {
final appState = getIt.get<AppState>();
// 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<SplashPage> {
} 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<SplashPage> {
// GetIt.instance<CacheService>().remove(key: CacheConst.isAppOpenedFromCall);
Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall);
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!)
.pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation())));
Navigator.pushReplacementNamed(
// context,
GetIt.instance<NavigationService>().navigatorKey.currentContext!,
@ -392,8 +390,6 @@ class _SplashScreenState extends State<SplashPage> {
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);
}
}

Loading…
Cancel
Save