From 3d877ed28da872b0ef97abeb81b7dd817da91f76 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 25 Mar 2026 13:34:31 +0300 Subject: [PATCH] Updates --- assets/langs/ar-SA.json | 4 +- assets/langs/en-US.json | 3 +- .../book_appointments_view_model.dart | 22 ++++++++++ lib/generated/locale_keys.g.dart | 3 +- .../appointment_details_page.dart | 12 ++--- .../widgets/appointment_card.dart | 4 +- .../book_appointment_page.dart | 28 ++++++++---- .../home/data/landing_page_data.dart | 8 ++-- lib/presentation/home/landing_page.dart | 2 +- .../home/widgets/large_service_card.dart | 5 ++- .../home_health_care/hhc_procedures_page.dart | 21 ++++++--- .../insurance_update_details_card.dart | 26 +++++------ .../widgets/patient_insurance_card.dart | 44 +++++++++++-------- .../medical_file/medical_file_page.dart | 44 +++++++++++-------- .../profile_settings/profile_settings.dart | 44 +++++++++++-------- lib/widgets/chip/app_custom_chip_widget.dart | 17 ++++--- 16 files changed, 181 insertions(+), 106 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 04684df5..071374e6 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -435,7 +435,6 @@ "serviceInformation": "معلومات الخدمة", "homeHealthCare": "الرعاية الصحية المنزلية", "noAppointmentAvailable": "لا توجد مواعيد متاحة", - "homeHealthCareText": "تقدم هذه الخدمة مجموعة من خدمات الرعاية الصحية المنزلية، والمتابعة المستمرة والشاملة في أماكن إقامتهم لأولئك الذين لا يمكنهم الوصول إلى المرافق الصحية، مثل (تحليلات المختبر - الأشعة - التطعيمات - العلاج الطبيعي)، إلخ.", "loginRegister": "تسجيل الدخول / التسجيل", "orderLog": "سجل الطلب", "infoLab": "تتيح لك هذه الخدمة عرض نتائج جميع الفحوصات المخبرية التي أجريت في مجموعة الحبيب الطبية بالإضافة إلى إرسال التقرير عبر البريد الإلكتروني.", @@ -1585,5 +1584,6 @@ "hmgPolicies": "سياسات مجموعة الحبيب الطبية", "darkMode": "المظهر الداكن", "generateAiAnalysisResult": "قم بإجراء تحليل لهذا المختبر AI", - "ratings": "التقييمات" + "ratings": "التقييمات", + "hmgPharmacyText": "صيدلية الحبيب، المتجر الصيدلاني الإلكتروني المتكامل الذي تقدمه لكم مجموعة خدمات الدكتور سليمان الحبيب الطبية." } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index c43d730e..a76898ba 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1578,5 +1578,6 @@ "hmgPolicies": "HMG Policies", "darkMode": "Dark Mode", "generateAiAnalysisResult": "Generate AI analysis for this result", - "ratings": "Ratings" + "ratings": "Ratings", + "hmgPharmacyText": "Al Habib Pharmacy, the complete online Pharmaceutical store brought to you by Dr. Sulaiman Al Habib Medical Services Group." } diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 676a299a..0d2a8f82 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -49,6 +49,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { bool isDoctorSearchByNameStarted = false; bool isAppointmentNearestGateLoading = false; + bool isLiveCareSelectedFromHomePage = false; bool isLiveCareSchedule = false; bool isGetDocForHealthCal = false; bool showSortFilterButtons = false; @@ -318,6 +319,11 @@ class BookAppointmentsViewModel extends ChangeNotifier { notifyListeners(); } + setIsLiveCareSelectedFromHomePage(bool isLiveCareSelectedFromHomePage) { + this.isLiveCareSelectedFromHomePage = isLiveCareSelectedFromHomePage; + notifyListeners(); + } + setIsWaitingAppointmentSelected(bool isWaitingAppointmentSelected) { this.isWaitingAppointmentSelected = isWaitingAppointmentSelected; notifyListeners(); @@ -423,9 +429,25 @@ class BookAppointmentsViewModel extends ChangeNotifier { calculationID = null; isGetDocForHealthCal = false; selectedTabIndex = index; + checkLiveCareSymptomCheckerStatus(); notifyListeners(); } + bool checkLiveCareSymptomCheckerStatus() { + bool isAllowed = false; + + if (selectedTabIndex == 1) { + if (_appState.isAuthenticated) { + isAllowed = true; + } else { + isAllowed = false; + } + } else { + isAllowed = true; + } + return isAllowed; + } + /// this function will decide which clinic api to be called /// either api for region flow or the select clinic api Future getClinics() async { diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 73a18102..951dbf90 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -436,7 +436,6 @@ abstract class LocaleKeys { static const serviceInformation = 'serviceInformation'; static const homeHealthCare = 'homeHealthCare'; static const noAppointmentAvailable = 'noAppointmentAvailable'; - static const homeHealthCareText = 'homeHealthCareText'; static const loginRegister = 'loginRegister'; static const orderLog = 'orderLog'; static const infoLab = 'infoLab'; @@ -746,6 +745,7 @@ abstract class LocaleKeys { static const infoTodo = 'infoTodo'; static const familyInfo = 'familyInfo'; static const rrtdDetails = 'rrtdDetails'; + static const homeHealthCareText = 'homeHealthCareText'; static const onlineCheckInAgreement = 'onlineCheckInAgreement'; static const infoEreferral = 'infoEreferral'; static const erConsultation = 'erConsultation'; @@ -1579,5 +1579,6 @@ abstract class LocaleKeys { static const darkMode = 'darkMode'; static const generateAiAnalysisResult = 'generateAiAnalysisResult'; static const ratings = 'ratings'; + static const hmgPharmacyText = 'hmgPharmacyText'; } diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index cafb740e..71cf4e16 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -69,12 +69,12 @@ class _AppointmentDetailsPageState extends State { @override void initState() { scheduleMicrotask(() async { - CalenderUtilsNew calendarUtils = await CalenderUtilsNew.instance; - var doesExist = await calendarUtils.checkIfEventExist("${widget.patientAppointmentHistoryResponseModel.appointmentNo}"); - myAppointmentsViewModel.setAppointmentReminder(doesExist, widget.patientAppointmentHistoryResponseModel); - setState((){ - - }); + if (!AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel)) { + CalenderUtilsNew calendarUtils = await CalenderUtilsNew.instance; + var doesExist = await calendarUtils.checkIfEventExist("${widget.patientAppointmentHistoryResponseModel.appointmentNo}"); + myAppointmentsViewModel.setAppointmentReminder(doesExist, widget.patientAppointmentHistoryResponseModel); + setState(() {}); + } }); super.initState(); diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 210de466..ac63432f 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -424,7 +424,9 @@ class AppointmentCard extends StatelessWidget { ), ); } else { - bookAppointmentsViewModel.getAppointmentNearestGate(projectID: patientAppointmentHistoryResponseModel.projectID, clinicID: patientAppointmentHistoryResponseModel.clinicID); + if (!AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) { + bookAppointmentsViewModel.getAppointmentNearestGate(projectID: patientAppointmentHistoryResponseModel.projectID, clinicID: patientAppointmentHistoryResponseModel.clinicID); + } Navigator.of(context) .push( CustomPageRoute( diff --git a/lib/presentation/book_appointment/book_appointment_page.dart b/lib/presentation/book_appointment/book_appointment_page.dart index ab548449..aea34ff0 100644 --- a/lib/presentation/book_appointment/book_appointment_page.dart +++ b/lib/presentation/book_appointment/book_appointment_page.dart @@ -61,7 +61,13 @@ class _BookAppointmentPageState extends State { immediateLiveCareViewModel.initImmediateLiveCare(); }); WidgetsBinding.instance.addPostFrameCallback((_) { - showUnKnownClinicBottomSheet(); + if (bookAppointmentsViewModel.selectedTabIndex == 1) { + if (appState.isAuthenticated) { + showUnKnownClinicBottomSheet(); + } + } else { + showUnKnownClinicBottomSheet(); + } }); super.initState(); } @@ -203,7 +209,9 @@ class _BookAppointmentPageState extends State { ), ), ), - _buildSymptomsBottomCard(), + Consumer(builder: (context, bookAppointmentsVM, child) { + return _buildSymptomsBottomCard(); + }), ], ), ); @@ -414,12 +422,13 @@ class _BookAppointmentPageState extends State { } Widget _buildSymptomsBottomCard() { - return Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), - child: Row( - children: [ - Expanded( - child: Column( + return bookAppointmentsViewModel.checkLiveCareSymptomCheckerStatus() + ? Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), + child: Row( + children: [ + Expanded( + child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -442,7 +451,8 @@ class _BookAppointmentPageState extends State { ) ], ).paddingAll(24.w), - ); + ) + : SizedBox.shrink(); } void openRegionListBottomSheet(BuildContext context, RegionBottomSheetType type) { diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart index b74e57f3..4606c800 100644 --- a/lib/presentation/home/data/landing_page_data.dart +++ b/lib/presentation/home/data/landing_page_data.dart @@ -165,8 +165,8 @@ class LandingPageData { serviceName: "home_health_care", icon: AppAssets.homeBottom, title: LocaleKeys.homeHealthCare, - subtitle: LocaleKeys.liveCareServiceDesc, - largeCardIcon: AppAssets.homeHealthCareService, + subtitle: LocaleKeys.homeHealthCareText, + largeCardIcon: AppAssets.homeHealthCareService, backgroundColor: AppColors.primaryRedColor, iconColor: AppColors.whiteColor, isBold: false, @@ -175,8 +175,8 @@ class LandingPageData { serviceName: "pharmacy", icon: AppAssets.pharmacy_icon, //359846 title: LocaleKeys.hmgPharmacy, - subtitle: LocaleKeys.liveCareServiceDesc, - largeCardIcon: AppAssets.pharmacyService, + subtitle: LocaleKeys.hmgPharmacyText, + largeCardIcon: AppAssets.pharmacyService, backgroundColor: AppColors.pharmacyBGColor, iconColor: null, isBold: true, diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index a7ae78b9..5d068b6c 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -258,7 +258,7 @@ class _LandingPageState extends State { ); }), !appState.isAuthenticated - ? Utils.buildSvgWithAssets(icon: AppAssets.changeLanguageHomePageIcon, height: 24.h, width: 24.h).onPress(() { + ? Utils.buildSvgWithAssets(icon: appState.isArabic() ? AppAssets.enLangIcon : AppAssets.arLangIcon, height: 24.h, width: 24.h).onPress(() { context.setLocale(appState.isArabic() ? Locale('en', 'US') : Locale('ar', 'SA')); }) : SizedBox.shrink() diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index 7c86dd09..4405a197 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -229,10 +229,10 @@ class FadedLargeServiceCard extends StatelessWidget { ], ), SizedBox(height: 10.h), - serviceCardData.subtitle.tr(context: context).toText14(weight: FontWeight.w500, color: AppColors.blackBgColor, letterSpacing: 0), + serviceCardData.subtitle.tr(context: context).toText14(weight: FontWeight.w500, color: AppColors.blackBgColor, letterSpacing: 0, maxlines: 2), SizedBox(height: 12.h), CustomButton( - text: serviceCardData.isBold ? "Visit Pharmacy Online".needTranslation : LocaleKeys.bookNow.tr(context: context), + text: serviceCardData.isBold ? LocaleKeys.visitPharmacyOnline.tr(context: context) : LocaleKeys.bookNow.tr(context: context), onPressed: () { handleOnTap(); }, @@ -255,6 +255,7 @@ class FadedLargeServiceCard extends StatelessWidget { case "livecare": { getIt.get().onTabChanged(1); + getIt.get().setIsLiveCareSelectedFromHomePage(true); Navigator.of(getIt.get().navigatorKey.currentContext!).push( CustomPageRoute( page: BookAppointmentPage(), diff --git a/lib/presentation/home_health_care/hhc_procedures_page.dart b/lib/presentation/home_health_care/hhc_procedures_page.dart index c420742c..88766ea0 100644 --- a/lib/presentation/home_health_care/hhc_procedures_page.dart +++ b/lib/presentation/home_health_care/hhc_procedures_page.dart @@ -8,6 +8,7 @@ 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/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_services_resp_model.dart'; @@ -33,11 +34,13 @@ class HhcProceduresPage extends StatefulWidget { } class _HhcProceduresPageState extends State { + + late AppState appState; + @override void initState() { super.initState(); final HmgServicesViewModel hmgServicesViewModel = context.read(); - final AppState appState = getIt.get(); scheduleMicrotask(() async { final user = appState.getAuthenticatedUser(); @@ -445,11 +448,12 @@ class _HhcProceduresPageState extends State { @override Widget build(BuildContext context) { + appState = getIt.get(); return Scaffold( backgroundColor: AppColors.bgScaffoldColor, body: CollapsingListView( title: LocaleKeys.homeHealthCare.tr(context: context), - history: () => Navigator.of(context).push(CustomPageRoute(page: HhcOrderDetailPage(), direction: AxisDirection.up)), + history: () => appState.isAuthenticated ? Navigator.of(context).push(CustomPageRoute(page: HhcOrderDetailPage(), direction: AxisDirection.up)) : null, bottomChild: Consumer( builder: (BuildContext context, HmgServicesViewModel hmgServicesViewModel, Widget? child) { if (hmgServicesViewModel.isHhcOrdersLoading || hmgServicesViewModel.isHhcServicesLoading) { @@ -467,8 +471,14 @@ class _HhcProceduresPageState extends State { padding: EdgeInsets.all(24.w), child: CustomButton( borderWidth: 0, - text: LocaleKeys.createNewRequest.tr(context: context), - onPressed: () => _buildServicesListBottomsSheet(hmgServicesViewModel.hhcServicesList), + text: appState.isAuthenticated ? LocaleKeys.createNewRequest.tr(context: context) : LocaleKeys.loginToUseService.tr(context: context), + onPressed: () { + if(appState.isAuthenticated) { + _buildServicesListBottomsSheet(hmgServicesViewModel.hhcServicesList); + } else { + getIt().onLoginPressed(); + } + }, textColor: AppColors.whiteColor, borderRadius: 12.r, borderColor: Colors.transparent, @@ -492,12 +502,13 @@ class _HhcProceduresPageState extends State { } else { return Column( children: [ + appState.isAuthenticated ? Center( child: Utils.getNoDataWidget( context, noDataText: LocaleKeys.youHaveNoPendingRequests.tr(context: context), ), - ), + ) : LocaleKeys.homeHealthCareText.tr(context: context).toText18(weight: FontWeight.w500).paddingSymmetrical(24.h, 24.h), ], ); } diff --git a/lib/presentation/insurance/widgets/insurance_update_details_card.dart b/lib/presentation/insurance/widgets/insurance_update_details_card.dart index 35be7f9e..bf86671e 100644 --- a/lib/presentation/insurance/widgets/insurance_update_details_card.dart +++ b/lib/presentation/insurance/widgets/insurance_update_details_card.dart @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; +import 'package:hmg_patient_app_new/core/utils/date_util.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/extensions/string_extensions.dart'; @@ -75,21 +76,18 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget { ], ), SizedBox(height: 8.h), - Row( + Wrap( + direction: Axis.horizontal, + spacing: 4.h, + runSpacing: 4.h, children: [ - Wrap( - direction: Axis.horizontal, - spacing: 4.h, - runSpacing: 4.h, - children: [ - AppCustomChipWidget( - icon: AppAssets.doctor_calendar_icon, - labelText: "${LocaleKeys.expiryOn.tr(context: context)} ${insuranceViewModel.patientInsuranceUpdateResponseModel!.effectiveTo}", - ), - AppCustomChipWidget( - labelText: "Member ID: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.memberID!}", - ), - ], + AppCustomChipWidget( + icon: AppAssets.doctor_calendar_icon, + labelText: + "${LocaleKeys.expiryOn.tr(context: context)} ${DateUtil.formatDateToDate(DateTime.parse(insuranceViewModel.patientInsuranceUpdateResponseModel!.effectiveTo!), false)}", + ), + AppCustomChipWidget( + labelText: "Member ID: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.memberID!}", ), ], ), diff --git a/lib/presentation/insurance/widgets/patient_insurance_card.dart b/lib/presentation/insurance/widgets/patient_insurance_card.dart index 2d3ba9ea..d6bb204f 100644 --- a/lib/presentation/insurance/widgets/patient_insurance_card.dart +++ b/lib/presentation/insurance/widgets/patient_insurance_card.dart @@ -79,27 +79,35 @@ class PatientInsuranceCard extends StatelessWidget { : AppColors.warningColorYellow, iconSize: 12.w, deleteIcon: insuranceViewModel.isInsuranceActive ? null : AppAssets.forward_chevron_icon, - deleteIconColor: AppColors.warningColorYellow, + deleteIconColor: insuranceViewModel.isInsuranceExpired + ? AppColors.primaryRedColor + : insuranceViewModel.isInsuranceActive + ? AppColors.successColor + : AppColors.warningColorYellow, deleteIconHasColor: true, onChipTap: () { if (!insuranceViewModel.isInsuranceActive) { - showCommonBottomSheetWithoutHeight( - title: LocaleKeys.notice.tr(context: context), - context, - child: Utils.getWarningWidget( - loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context), - confirmText: LocaleKeys.contactUs.tr(context: context), - isShowActionButtons: true, - onCancelTap: () { - Navigator.pop(context); - }, - onConfirmTap: () async { - launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); - }), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); + insuranceViewModel.setIsInsuranceUpdateDetailsLoading(true); + insuranceViewModel.getPatientInsuranceDetailsForUpdate( + appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString()); + showCommonBottomSheetWithoutHeight(context, child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false); + // showCommonBottomSheetWithoutHeight( + // title: LocaleKeys.notice.tr(context: context), + // context, + // child: Utils.getWarningWidget( + // loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context), + // confirmText: LocaleKeys.contactUs.tr(context: context), + // isShowActionButtons: true, + // onCancelTap: () { + // Navigator.pop(context); + // }, + // onConfirmTap: () async { + // launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); + // }), + // callBackFunc: () {}, + // isFullScreen: false, + // isCloseButtonVisible: true, + // ); } }, backgroundColor: insuranceViewModel.isInsuranceExpired diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 89843ea7..b804a751 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -312,27 +312,35 @@ class _MedicalFilePageState extends State { : AppColors.warningColorYellow, iconSize: 12.w, deleteIcon: insuranceVM.isInsuranceActive ? null : AppAssets.forward_chevron_icon, - deleteIconColor: AppColors.warningColorYellow, + deleteIconColor: insuranceVM.isInsuranceExpired + ? AppColors.primaryRedColor + : insuranceVM.isInsuranceActive + ? AppColors.successColor + : AppColors.warningColorYellow, deleteIconHasColor: true, onChipTap: () { if (!insuranceVM.isInsuranceActive) { - showCommonBottomSheetWithoutHeight( - title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), - navigationService.navigatorKey.currentContext!, - child: Utils.getWarningWidget( - loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context), - confirmText: LocaleKeys.contactUs.tr(context: context), - isShowActionButtons: true, - onCancelTap: () { - navigationService.pop(); - }, - onConfirmTap: () async { - launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); - }), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); + insuranceVM.setIsInsuranceUpdateDetailsLoading(true); + insuranceVM.getPatientInsuranceDetailsForUpdate( + appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString()); + showCommonBottomSheetWithoutHeight(context, child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false); + // showCommonBottomSheetWithoutHeight( + // title: LocaleKeys.notice.tr(context: navigationService.navigatorKey.currentContext!), + // navigationService.navigatorKey.currentContext!, + // child: Utils.getWarningWidget( + // loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context), + // confirmText: LocaleKeys.contactUs.tr(context: context), + // isShowActionButtons: true, + // onCancelTap: () { + // navigationService.pop(); + // }, + // onConfirmTap: () async { + // launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); + // }), + // callBackFunc: () {}, + // isFullScreen: false, + // isCloseButtonVisible: true, + // ); } }, backgroundColor: insuranceVM.isInsuranceExpired diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index 27f74826..7d6af196 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -23,6 +23,7 @@ import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_v import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart'; import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart'; +import 'package:hmg_patient_app_new/presentation/insurance/widgets/insurance_update_details_card.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/app_language_change.dart'; @@ -431,27 +432,34 @@ class FamilyCardWidget extends StatelessWidget { : AppColors.warningColorYellow, iconSize: 12.w, deleteIcon: insuranceVM.isInsuranceActive ? null : AppAssets.forward_chevron_icon, - deleteIconColor: AppColors.warningColorYellow, + deleteIconColor: insuranceVM.isInsuranceExpired + ? AppColors.primaryRedColor + : insuranceVM.isInsuranceActive + ? AppColors.successColor + : AppColors.warningColorYellow, deleteIconHasColor: true, onChipTap: () { if (!insuranceVM.isInsuranceActive) { - showCommonBottomSheetWithoutHeight( - title: LocaleKeys.notice.tr(context: context), - context, - child: Utils.getWarningWidget( - loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context), - confirmText: LocaleKeys.contactUs.tr(context: context), - isShowActionButtons: true, - onCancelTap: () { - Navigator.pop(context); - }, - onConfirmTap: () async { - launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); - }), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); + insuranceVM.setIsInsuranceUpdateDetailsLoading(true); + insuranceVM.getPatientInsuranceDetailsForUpdate(appState.getAuthenticatedUser()!.patientId.toString(), appState.getAuthenticatedUser()!.patientIdentificationNo.toString()); + showCommonBottomSheetWithoutHeight(context, child: PatientInsuranceCardUpdateCard(), callBackFunc: () {}, title: "", isCloseButtonVisible: false, isFullScreen: false); + // showCommonBottomSheetWithoutHeight( + // title: LocaleKeys.notice.tr(context: context), + // context, + // child: Utils.getWarningWidget( + // loadingText: LocaleKeys.insuranceInActiveContactSupport.tr(context: context), + // confirmText: LocaleKeys.contactUs.tr(context: context), + // isShowActionButtons: true, + // onCancelTap: () { + // Navigator.pop(context); + // }, + // onConfirmTap: () async { + // launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); + // }), + // callBackFunc: () {}, + // isFullScreen: false, + // isCloseButtonVisible: true, + // ); } }, backgroundColor: insuranceVM.isInsuranceExpired diff --git a/lib/widgets/chip/app_custom_chip_widget.dart b/lib/widgets/chip/app_custom_chip_widget.dart index 0a6d1169..b2ae4288 100644 --- a/lib/widgets/chip/app_custom_chip_widget.dart +++ b/lib/widgets/chip/app_custom_chip_widget.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_state.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/extensions/string_extensions.dart'; @@ -101,12 +103,15 @@ class AppCustomChipWidget extends StatelessWidget { deleteIcon: deleteIcon?.isNotEmpty == true ? InkWell( onTap: onDeleteTap, - child: Utils.buildSvgWithAssets( - icon: deleteIcon!, - width: iconS, - height: iconS, - iconColor: deleteIconHasColor ? resolvedDeleteIconColor : null, - applyThemeColor: applyThemeColor, + child: Transform.flip( + flipX: getIt.get().isArabic(), + child: Utils.buildSvgWithAssets( + icon: deleteIcon!, + width: iconS, + height: iconS, + iconColor: deleteIconHasColor ? resolvedDeleteIconColor : null, + applyThemeColor: applyThemeColor, + ), ), ) : null,