From fb37d694117b49fb468d3002f2e9e13f0e600ac6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Sep 2026 12:57:12 +0300 Subject: [PATCH 1/2] Update to stores, VersionID 22.3 --- assets/images/svg/Icon-migrate.svg | 10 ++ assets/langs/ar-SA.json | 6 +- assets/langs/en-US.json | 6 +- lib/app_closed_page.dart | 104 ++++++++++++++++++ lib/core/api/api_client.dart | 2 +- lib/core/api_consts.dart | 6 +- lib/core/app_assets.dart | 1 + .../authentication_view_model.dart | 9 +- lib/generated/locale_keys.g.dart | 4 + lib/splashPage.dart | 16 ++- 10 files changed, 148 insertions(+), 16 deletions(-) create mode 100644 assets/images/svg/Icon-migrate.svg create mode 100644 lib/app_closed_page.dart diff --git a/assets/images/svg/Icon-migrate.svg b/assets/images/svg/Icon-migrate.svg new file mode 100644 index 00000000..b8dc647f --- /dev/null +++ b/assets/images/svg/Icon-migrate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 911856ab..a09efff5 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -2050,5 +2050,9 @@ "liveCareTermsConditions46": "13-3\tإذا تبين أن أي بند أو جزء من أي بند من هذه الشروط والأحكام باطل أو غير قابل للإنفاذ أو غير صالح، فسيتم فصله عن هذه الشروط والأحكام، تاركاً باقي الشروط سارية المفعول بكامل الأثر والنفاذ، بشرط ألا يغير فصل ذلك البند من الطبيعة الأساسية لهذه الشروط والأحكام.", "liveCareTermsHeading16": "14.\tالشكاوى", "liveCareTermsConditions47": "خدمات الرعاية الصحية عن بُعد الخاصة بنا سوف تكون لتخصصات طبية محددة أو لمواعيد المتابعة أو إعادة صرف الدواء. ", - "liveCareTermsConditions48": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011" + "liveCareTermsConditions48": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011", + "importantNotice": "تنبيه هام", + "appDecommissionedText": "تم إيقاف هذا الإصدار من تطبيق الحبيب الطبي.\nللاستمرار في الاستفادة من الخدمات الصحية والسجلات الطبية، يرجى تحميل التطبيق الجديد.", + "appDecommissionedSubText": "نعتذر بشدة عن الإزعاج الناتج عن هذا الانتقال.", + "downloadApp": "حمل التطبيق" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index aaafb124..d7cd2411 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -2040,7 +2040,11 @@ "liveCareTermsConditions46": "13.3 If any clause or part of any clause of these Terms & Conditions is found to be void, unenforceable or invalid, then it will be severed from these Terms & Conditions, leaving the remainder in full force and effect, provided that the severance has not altered the basic nature of these Terms & Conditions. ", "liveCareTermsHeading16": "14. COMPLAINTS", "liveCareTermsConditions47": "Our Telehealth Services will be for specific medical specialties or follow-up or medication refill appointments.", - "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" + "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", + "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.", + "downloadApp": "Download App" } diff --git a/lib/app_closed_page.dart b/lib/app_closed_page.dart new file mode 100644 index 00000000..2cda8935 --- /dev/null +++ b/lib/app_closed_page.dart @@ -0,0 +1,104 @@ +import 'dart:io'; + +import 'package:clarity_flutter/clarity_flutter.dart'; +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:freerasp/freerasp.dart'; +import 'package:hmg_patient_app_new/core/app_assets.dart'; +import 'package:hmg_patient_app_new/core/dependencies.dart'; +import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; +import 'package:hmg_patient_app_new/core/utils/utils.dart'; +import 'package:hmg_patient_app_new/services/security_service.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; + +import 'generated/locale_keys.g.dart'; +import 'widgets/buttons/custom_button.dart'; + +class AppClosedPage extends StatefulWidget { + const AppClosedPage({super.key}); + + @override + State createState() => _AppClosedPageState(); +} + +class _AppClosedPageState extends State { + @override + void initState() { + // Clarity.setCurrentScreenName('Unsafe Device Page'); + Talsec.instance.detachListener(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.whiteColor, + body: SafeArea( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 24.w), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Logo + Utils.buildImgWithAssets(icon: AppAssets.hmgLogo, width: MediaQuery.of(context).size.width * 0.7, height: 90.h, fit: BoxFit.contain), + SizedBox(height: 32.h), + Text( + LocaleKeys.importantNotice.tr(context: context), + style: TextStyle( + fontSize: 28.f, + fontWeight: FontWeight.bold, + color: AppColors.textColor, + ), + textAlign: TextAlign.center, + ), + SizedBox(height: 16.h), + // Description + Text( + LocaleKeys.appDecommissionedText.tr(context: context), + style: TextStyle( + fontSize: 14.f, + color: Colors.black87, + ), + textAlign: TextAlign.center, + ), + SizedBox(height: 24.h), + Text( + LocaleKeys.appDecommissionedSubText.tr(context: context), + style: TextStyle(fontSize: 14.f, color: AppColors.textColorLight, fontStyle: FontStyle.italic), + textAlign: TextAlign.center, + ), + SizedBox(height: 48.h), + CustomButton( + text: LocaleKeys.downloadApp.tr(context: context), + onPressed: () { + if (Platform.isAndroid) { + Utils.openWebView( + url: "https://play.google.com/store/apps/details?id=com.ejada.hmg", + ); + } + if (Platform.isIOS) { + Utils.openWebView( + url: "https://itunes.apple.com/app/id733503978", + ); + } + }, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + textColor: AppColors.whiteColor, + fontSize: (isFoldable || isTablet) ? 12.f : 14.f, + fontWeight: FontWeight.w600, + borderRadius: 12.r, + padding: EdgeInsets.symmetric(horizontal: 10.w), + // height: isTablet || isFoldable ? 46.h : 40.h, + height: 56.h, + iconColor: AppColors.primaryRedColor, + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 7a6096bc..00eebb34 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -209,7 +209,7 @@ class ApiClientImp implements ApiClient { body['TokenID'] = "@dm!n"; } - // body['TokenID'] = "@dm!n"; + body['TokenID'] = "@dm!n"; // body['PatientID'] = 7000792; // body['PatientID'] = 53320; // body['PatientTypeID'] = 1; diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 44a105b9..daa51bba 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -6,7 +6,7 @@ import 'package:myfatoorah_flutter/myfatoorah_flutter.dart'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT @@ -316,7 +316,7 @@ class ApiConsts { static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; // ************ static values for Api **************** - static final double appVersionID = 22.1; + static final double appVersionID = 22.3; // static final double appVersionID = 50.7; static final int appChannelId = 3; @@ -386,8 +386,6 @@ var DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; //weather var WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; -var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; - // Wifi Credentials var WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart index bd850985..bd6d7f87 100644 --- a/lib/core/app_assets.dart +++ b/lib/core/app_assets.dart @@ -385,6 +385,7 @@ class AppAssets { static const String hmg_pharmacy_logo = '$svgBasePath/hmg_pharmacy_logo.svg'; static const String redeem_icon = '$svgBasePath/redeem_icon.svg'; static const String expired_icon = '$svgBasePath/expired_icon.svg'; + static const String icon_migrate = '$svgBasePath/Icon-migrate.svg'; //Health Calculators static const String bodyfatcalc = '$svgBasePath/bfc.svg'; diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 271c628d..d448c88b 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -7,6 +7,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart' show rootBundle; import 'package:get_it/get_it.dart'; +import 'package:hmg_patient_app_new/app_closed_page.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/cache_consts.dart'; @@ -1827,10 +1828,10 @@ class AuthenticationViewModel extends ChangeNotifier { _appState.setNHICUserData = CheckUserStatusResponseNHIC(); _appState.setUserRegistrationPayload = RegistrationDataModelPayload(); // Clear privilege lists - _appState.setPrivilegeModelList([]); - _appState.setVidaPlusProjectList([]); - _appState.setHMCProjectList([]); - _appState.setProjectsDetailList([]); + // _appState.setPrivilegeModelList([]); + // _appState.setVidaPlusProjectList([]); + // _appState.setHMCProjectList([]); + // _appState.setProjectsDetailList([]); _appState.clearUserSwitchPayloads(); await clearDefaultInputValues(); _navigationService.pushAndReplace(AppRoutes.landingScreen); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 7dbcfd75..67aacc0e 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -2032,5 +2032,9 @@ abstract class LocaleKeys { static const liveCareTermsHeading16 = 'liveCareTermsHeading16'; static const liveCareTermsConditions47 = 'liveCareTermsConditions47'; static const liveCareTermsConditions48 = 'liveCareTermsConditions48'; + static const importantNotice = 'importantNotice'; + static const appDecommissionedText = 'appDecommissionedText'; + static const appDecommissionedSubText = 'appDecommissionedSubText'; + static const downloadApp = 'downloadApp'; } diff --git a/lib/splashPage.dart b/lib/splashPage.dart index cf407d41..8ebe655e 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_callkit_incoming/entities/call_event.dart'; import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart'; import 'package:get_it/get_it.dart'; +import 'package:hmg_patient_app_new/app_closed_page.dart'; import 'package:hmg_patient_app_new/core/api/api_client.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; @@ -29,6 +30,7 @@ import 'package:hmg_patient_app_new/services/notification_service.dart'; import 'package:hmg_patient_app_new/services/zoom_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/unsafe_device.dart'; +import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; import 'package:lottie/lottie.dart'; import 'package:safe_device/safe_device.dart'; @@ -91,12 +93,16 @@ class _SplashScreenState extends State { if (isAppOpenedFromCall) { navigateToTeleConsult(); } 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())); + if (Utils.havePrivilege(124)) { + Navigator.of(getIt.get().navigatorKey.currentContext!).pushAndRemoveUntil(CustomPageRoute(page: AppClosedPage()), (r) => false); } else { - // Navigator.of(context).pushReplacement(FadePage(page: SplashAnimationScreen(routeWidget: LandingNavigation()))); - Navigator.of(getIt.get().navigatorKey.currentContext!).pushReplacement(FadePage(page: LandingNavigation())); + 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())); + } } } } -- 2.30.2 From d3a799de7176956db9c7f3029812ca42032c64fb Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Sep 2026 15:26:14 +0300 Subject: [PATCH 2/2] Auth update --- lib/features/authentication/authentication_view_model.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index d448c88b..ae984002 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -1827,11 +1827,13 @@ class AuthenticationViewModel extends ChangeNotifier { _appState.setSelectDeviceByImeiRespModelElement(null); _appState.setNHICUserData = CheckUserStatusResponseNHIC(); _appState.setUserRegistrationPayload = RegistrationDataModelPayload(); + // Clear privilege lists // _appState.setPrivilegeModelList([]); // _appState.setVidaPlusProjectList([]); // _appState.setHMCProjectList([]); // _appState.setProjectsDetailList([]); + _appState.clearUserSwitchPayloads(); await clearDefaultInputValues(); _navigationService.pushAndReplace(AppRoutes.landingScreen); -- 2.30.2