From 841fca027cdd8a67dda40c22efdc95d72cf623cd Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Mar 2026 17:26:16 +0300 Subject: [PATCH] updates --- assets/langs/ar-SA.json | 5 +- assets/langs/en-US.json | 5 +- lib/core/utils/utils.dart | 18 +- lib/generated/locale_keys.g.dart | 3 +- .../appointment_details_page.dart | 8 +- .../hospital_bottom_sheet_body.dart | 169 ++++++++++-------- .../region_list_widget.dart | 12 +- .../immediate_livecare_payment_details.dart | 30 ++-- .../review_appointment_page.dart | 14 +- .../book_appointment/select_clinic_page.dart | 9 +- .../widgets/appointment_calendar.dart | 4 +- .../book_appointment/widgets/doctor_card.dart | 24 +-- .../emergency_services_page.dart | 114 ++++++------ ...r_online_checkin_payment_details_page.dart | 2 +- .../er_online_checkin_payment_page.dart | 12 +- lib/presentation/home/landing_page.dart | 122 ++++++------- .../home/widgets/habib_wallet_card.dart | 2 +- .../prescriptions/prescription_item_view.dart | 2 +- .../prescription_reminder_view.dart | 4 +- .../profile_settings/profile_settings.dart | 2 +- .../widgets/preferred_language_widget.dart | 2 +- .../ancillary_procedures_details_page.dart | 2 +- lib/widgets/scroll_wheel_time_picker.dart | 17 +- 23 files changed, 319 insertions(+), 263 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index a2527f6e..45922943 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1597,8 +1597,9 @@ "tests": "تحليل", "calendarPermissionAlert": "يرجى منح إذن الوصول إلى التقويم من إعدادات التطبيق لضبط تذكير تناول الدواء.", "sortByNearestLocation": "فرز حسب الأقرب إلى موقعك", - "giveLocationPermissionForNearestList": "يرجى منح إذن الوصول إلى الموقع من إعدادات التطبيق لعرض أقرب المواقع." + "giveLocationPermissionForNearestList": "يرجى منح إذن الوصول إلى الموقع من إعدادات التطبيق لعرض أقرب المواقع.", "sortByLocation": "الترتيب حسب الموقع", "timeForFirstReminder": "وقت التذكير الأول", - "reminderRemovalNote": "يمكنك إزالتها من التقويم الخاص بك لاحقاً عن طريق إيقاف تشغيل التذكير" + "reminderRemovalNote": "يمكنك إزالتها من التقويم الخاص بك لاحقاً عن طريق إيقاف تشغيل التذكير", + "communicationLanguage": "لغة التواصل" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index de754118..59ecb6c2 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1591,8 +1591,9 @@ "tests": "tests", "calendarPermissionAlert": "Please grant calendar access permission from app settings to set medication reminder.", "timeForFirstReminder": "Time for 1st reminder", - "reminderRemovalNote": "You can remove it from your calendar later by switching off the reminder" + "reminderRemovalNote": "You can remove it from your calendar later by switching off the reminder", "sortByLocation": "Sort by location", "sortByNearestLocation": "Sort by nearest to your location", - "giveLocationPermissionForNearestList": "Please grant location permission from app settings to see the nearest locations." + "giveLocationPermissionForNearestList": "Please grant location permission from app settings to see the nearest locations.", + "communicationLanguage": "Communication Language" } diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 0d600bd7..0fb8f1ad 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -382,7 +382,7 @@ class Utils { children: [ Lottie.asset(AppAnimations.checkmark, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), SizedBox(height: 8.h), - (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor), + (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor).paddingSymmetrical(24.h, 0.h), SizedBox(height: 8.h), ], ).center; @@ -396,7 +396,7 @@ class Utils { Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), SizedBox(height: 8.h), - (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor), + (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor).paddingSymmetrical(24.h, 0.h), SizedBox(height: 8.h), ], ).center; @@ -749,20 +749,20 @@ class Utils { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Image.asset(AppAssets.mada, width: 25.h, height: 25.h), + Image.asset(AppAssets.mada, width: 35.h, height: 35.h), Image.asset( AppAssets.tamaraEng, - width: 25.h, - height: 25.h, + width: 35.h, + height: 35.h, fit: BoxFit.contain, errorBuilder: (context, error, stackTrace) { debugPrint('Failed to load Tamara PNG in payment methods: $error'); - return Utils.buildSvgWithAssets(icon: AppAssets.tamara, width: 25.h, height: 25.h, fit: BoxFit.contain); + return Utils.buildSvgWithAssets(icon: AppAssets.tamara, width: 35.h, height: 35.h, fit: BoxFit.contain); }, ), - Image.asset(AppAssets.visa, width: 25.h, height: 25.h), - Image.asset(AppAssets.mastercard, width: 25.h, height: 25.h), - Image.asset(AppAssets.applePay, width: 25.h, height: 25.h), + Image.asset(AppAssets.visa, width: 35.h, height: 35.h), + Image.asset(AppAssets.mastercard, width: 35.h, height: 25.h), + Image.asset(AppAssets.applePay, width: 35.h, height: 35.h), ], ); } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index b6443d0f..0bbe4bd3 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1590,10 +1590,11 @@ abstract class LocaleKeys { static const verifyInsurance = 'verifyInsurance'; static const tests = 'tests'; static const calendarPermissionAlert = 'calendarPermissionAlert'; - static const sortByLocation = 'sortByLocation'; static const sortByNearestLocation = 'sortByNearestLocation'; static const giveLocationPermissionForNearestList = 'giveLocationPermissionForNearestList'; + static const sortByLocation = 'sortByLocation'; static const timeForFirstReminder = 'timeForFirstReminder'; static const reminderRemovalNote = 'reminderRemovalNote'; + static const communicationLanguage = 'communicationLanguage'; } diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 072cb04a..176b3771 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -286,7 +286,7 @@ class _AppointmentDetailsPageState extends State { Positioned( bottom: 0, child: SizedBox( - width: MediaQuery.of(context).size.width * 0.785, + width: MediaQuery.of(context).size.width - 85.w, child: CustomButton( onPressed: () async { if (widget.patientAppointmentHistoryResponseModel.projectID == 130 || widget.patientAppointmentHistoryResponseModel.projectID == 120) { @@ -394,7 +394,6 @@ class _AppointmentDetailsPageState extends State { }, isMultiAllowed: true, onMultiDateSuccess: (int selectedIndex) async { - isEventAddedOrRemoved = await calender.createOrUpdateEvent( title: "Appointment Reminder with ${widget.patientAppointmentHistoryResponseModel.doctorNameObj} on ${DateUtil.convertStringToDate(widget.patientAppointmentHistoryResponseModel.appointmentDate)}, Appointment #${widget.patientAppointmentHistoryResponseModel.appointmentNo}", @@ -822,8 +821,7 @@ class _AppointmentDetailsPageState extends State { child: LocaleKeys.upcomingPaymentNow .tr(context: context) .toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor)), - "VAT 15%(${widget.patientAppointmentHistoryResponseModel.patientTaxAmount})" - .toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -2), + "VAT 15%(${widget.patientAppointmentHistoryResponseModel.patientTaxAmount})".toText14(isBold: true, color: AppColors.greyTextColor, letterSpacing: -0.64), ], ), SizedBox(height: 18.h), @@ -831,7 +829,7 @@ class _AppointmentDetailsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - width: 150.h, + width: 200.h, child: Utils.getPaymentMethods(), ), Row( diff --git a/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart b/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart index 56a04636..8904e585 100644 --- a/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart +++ b/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart @@ -7,12 +7,14 @@ import 'package:hmg_patient_app_new/core/utils/size_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/core/utils/utils.dart' show Utils; +import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/facility_selection.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/doctor_list_api_response.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart'; import 'package:hmg_patient_app_new/theme/colors.dart' show AppColors; import 'package:hmg_patient_app_new/widgets/input_widget.dart'; +import 'package:provider/provider.dart'; import '../../../emergency_services/call_ambulance/widgets/type_selection_widget.dart' show TypeSelectionWidget; @@ -131,91 +133,104 @@ class HospitalBottomSheetBody extends StatelessWidget { @override Widget build(BuildContext context) { - - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - TextInputWidget( - labelText: LocaleKeys.search.tr(context: context), - hintText: LocaleKeys.searchHospital.tr(context: context), - controller: searchText, - onChange: (value) { - debouncer.run((){ - onHospitalSearch(value??""); - }); - }, - isEnable: true, - prefix: null, - - autoFocus: false, - isBorderAllowed: false, - keyboardType: TextInputType.text, - isAllowLeadingIcon: true, - selectionType: SelectionTypeEnum.search, - padding: EdgeInsets.symmetric( - vertical: ResponsiveExtension(10).h, - horizontal: ResponsiveExtension(15).h, + return Consumer(builder: (context, myAppointmentsVM, child) { + if (myAppointmentsVM.isRegionListLoading) { + return Container( + height: MediaQuery.of(context).size.height * 0.3, + decoration: BoxDecoration( + color: AppColors.whiteColor, + borderRadius: BorderRadius.vertical(top: Radius.circular(16)), + ), + child: Center( + child: Utils.getLoadingWidget(), ), - ), - SizedBox(height: 16.h), - if (onSortByLocationToggle != null) - Padding( - padding: EdgeInsets.symmetric(horizontal: 4.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( + ); + } else { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextInputWidget( + labelText: LocaleKeys.search.tr(context: context), + hintText: LocaleKeys.searchHospital.tr(context: context), + controller: searchText, + onChange: (value) { + debouncer.run(() { + onHospitalSearch(value ?? ""); + }); + }, + isEnable: true, + prefix: null, + autoFocus: false, + isBorderAllowed: false, + keyboardType: TextInputType.text, + isAllowLeadingIcon: true, + selectionType: SelectionTypeEnum.search, + padding: EdgeInsets.symmetric( + vertical: ResponsiveExtension(10).h, + horizontal: ResponsiveExtension(15).h, + ), + ), + SizedBox(height: 16.h), + if (onSortByLocationToggle != null) + Padding( + padding: EdgeInsets.symmetric(horizontal: 4.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.location, iconColor: AppColors.greyTextColor, width: 18.h, height: 18.h), - SizedBox(width: 8.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, + Row( children: [ - LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true), - // SizedBox(height: 4.h), - LocaleKeys.sortByNearestLocation.tr(context: context).toText11(color: AppColors.textColorLight, weight: FontWeight.w500), + Utils.buildSvgWithAssets(icon: AppAssets.location, iconColor: AppColors.greyTextColor, width: 18.h, height: 18.h), + SizedBox(width: 8.w), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.sortByLocation.tr(context: context).toText14(isBold: true), + // SizedBox(height: 4.h), + LocaleKeys.sortByNearestLocation.tr(context: context).toText11(color: AppColors.textColorLight, weight: FontWeight.w500), + ], + ), ], ), + Switch( + value: sortByLocation, + onChanged: onSortByLocationToggle, + activeThumbColor: AppColors.successColor, + activeTrackColor: AppColors.successColor.withValues(alpha: 0.15), + ), ], ), - Switch( - value: sortByLocation, - onChanged: onSortByLocationToggle, - activeThumbColor: AppColors.successColor, - activeTrackColor: AppColors.successColor.withValues(alpha: 0.15), - ), - ], - ), - ), - if (onSortByLocationToggle != null) SizedBox(height: 8.h), - TypeSelectionWidget( - selectedFacility:selectedFacility , - hmcCount: hmcCount.toString(), - hmgCount: hmgCount.toString(), - onitemClicked: (selectedValue){ - onFacilityClicked(selectedValue); - }, - ), - SizedBox(height: 21.h), - SizedBox( - height: MediaQuery.sizeOf(context).height * .4, - child: ListView.separated( - itemBuilder: (_, index) - { - var hospital = displayList?[index]; - return HospitalListItem( - hospitalData: hospital, - isLocationEnabled: sortByLocation, - ).onPress(() { - onHospitalClicked(hospital!); - });}, - separatorBuilder: (_, __) => SizedBox( - height: 16.h, ), - itemCount: displayList?.length ?? 0, - )) - ], - ); + if (onSortByLocationToggle != null) SizedBox(height: 8.h), + TypeSelectionWidget( + selectedFacility: selectedFacility, + hmcCount: hmcCount.toString(), + hmgCount: hmgCount.toString(), + onitemClicked: (selectedValue) { + onFacilityClicked(selectedValue); + }, + ), + SizedBox(height: 21.h), + SizedBox( + height: MediaQuery.sizeOf(context).height * .4, + child: ListView.separated( + itemBuilder: (_, index) { + var hospital = displayList?[index]; + return HospitalListItem( + hospitalData: hospital, + isLocationEnabled: sortByLocation, + ).onPress(() { + onHospitalClicked(hospital!); + }); + }, + separatorBuilder: (_, __) => SizedBox( + height: 16.h, + ), + itemCount: displayList?.length ?? 0, + )) + ], + ); + } + }); } } diff --git a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart index 5676806e..2b3a6ffc 100644 --- a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart +++ b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart @@ -188,7 +188,11 @@ class _RegionBottomSheetBodyState extends State { isShowConfirmDialog: true, onSuccess: (latLng) { regionalViewModel.setSortByLocation(true); - myAppointmentsViewModel.getRegionMappedProjectList(); + if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_REGION || regionalViewModel.regionBottomSheetType == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER) { + myAppointmentsViewModel.getRegionMappedProjectList(); + } else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) { + myAppointmentsViewModel.getMappedDoctors(); + } }, onFailure: () { showCommonBottomSheetWithoutHeight( @@ -236,7 +240,11 @@ class _RegionBottomSheetBodyState extends State { final appState = getIt.get(); appState.resetLocation(); regionalViewModel.setSortByLocation(false); - myAppointmentsViewModel.getRegionMappedProjectList(); + if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_REGION || regionalViewModel.regionBottomSheetType == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER) { + myAppointmentsViewModel.getRegionMappedProjectList(); + } else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) { + myAppointmentsViewModel.getMappedDoctors(); + } } } } diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart index 7c2784de..c885b595 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart @@ -7,6 +7,7 @@ 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/int_extensions.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/book_appointments/book_appointments_view_model.dart'; @@ -82,9 +83,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { runSpacing: 4.h, children: [ AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} ${LocaleKeys.yearsOld.tr(context: context)}"), - AppCustomChipWidget( - labelText: - "${LocaleKeys.clinic.tr()}: ${(appState.isArabic() ? immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceNameN : immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceName) ?? ""}"), + AppCustomChipWidget(labelText: "${LocaleKeys.gender.tr(context: context)}: ${appState.getAuthenticatedUser()?.gender == 1 ? LocaleKeys.malE.tr(context: context) : LocaleKeys.femaleGender.tr(context: context)}"), ], ), ], @@ -105,17 +104,28 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { ), child: Padding( padding: EdgeInsets.all(16.h), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppCustomChipWidget( + labelText: + "${LocaleKeys.clinic.tr()}: ${(appState.isArabic() ? immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceNameN : immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceName) ?? ""}"), + SizedBox(height: 16.h), + 1.divider, + SizedBox(height: 16.h), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Utils.buildSvgWithAssets(icon: getLiveCareTypeIcon(immediateLiveCareVM.liveCareSelectedCallType), width: 32.h, height: 32.h, fit: BoxFit.contain, applyThemeColor: false), - SizedBox(width: 8.h), - getLiveCareType(context, immediateLiveCareVM.liveCareSelectedCallType).toText16(isBold: true), + Row( + children: [ + Utils.buildSvgWithAssets(icon: getLiveCareTypeIcon(immediateLiveCareVM.liveCareSelectedCallType), width: 32.h, height: 32.h, fit: BoxFit.contain, applyThemeColor: false), + SizedBox(width: 8.h), + getLiveCareType(context, immediateLiveCareVM.liveCareSelectedCallType).toText16(isBold: true), + ], + ), + Utils.buildSvgWithAssets(icon: AppAssets.edit_icon, width: 24.h, height: 24.h, fit: BoxFit.contain), ], ), - Utils.buildSvgWithAssets(icon: AppAssets.edit_icon, width: 24.h, height: 24.h, fit: BoxFit.contain), ], ), ), @@ -202,7 +212,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox(width: 150.h, child: Utils.getPaymentMethods()), + SizedBox(width: 200.h, child: Utils.getPaymentMethods()), Utils.getPaymentAmountWithSymbol(immediateLiveCareVM.liveCareImmediateAppointmentFeesList.total!.toText24(isBold: true), AppColors.blackColor, 17, isSaudiCurrency: (immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "sar" || immediateLiveCareVM.liveCareImmediateAppointmentFeesList.currency!.toLowerCase() == "ريال")), diff --git a/lib/presentation/book_appointment/review_appointment_page.dart b/lib/presentation/book_appointment/review_appointment_page.dart index 794b821b..9069138f 100644 --- a/lib/presentation/book_appointment/review_appointment_page.dart +++ b/lib/presentation/book_appointment/review_appointment_page.dart @@ -109,8 +109,8 @@ class _ReviewAppointmentPageState extends State { SizedBox(height: 12.h), Wrap( direction: Axis.horizontal, - spacing: 8.h, - runSpacing: 8.h, + spacing: 4.h, + runSpacing: 4.h, children: [ AppCustomChipWidget( labelText: "${LocaleKeys.clinic.tr(context: context)}: ${bookAppointmentsViewModel.selectedDoctor.clinicName}", @@ -156,7 +156,15 @@ class _ReviewAppointmentPageState extends State { children: [ "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText16(isBold: true), SizedBox(height: 8.h), - AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} Years Old"), + Wrap( + direction: Axis.horizontal, + spacing: 4.h, + runSpacing: 4.h, + children: [ + AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} Years Old"), + AppCustomChipWidget(labelText: "${LocaleKeys.gender.tr(context: context)}: ${appState.getAuthenticatedUser()?.gender == 1 ? LocaleKeys.malE.tr(context: context) : LocaleKeys.femaleGender.tr(context: context)}"), + ], + ), ], ), ], diff --git a/lib/presentation/book_appointment/select_clinic_page.dart b/lib/presentation/book_appointment/select_clinic_page.dart index ca3381b5..aaa52217 100644 --- a/lib/presentation/book_appointment/select_clinic_page.dart +++ b/lib/presentation/book_appointment/select_clinic_page.dart @@ -1340,6 +1340,13 @@ class _SelectClinicPageState extends State { } } bookAppointmentsViewModel.addListener(listener); - bookAppointmentsViewModel.getRegionMappedProjectList(); + + if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_REGION || regionalViewModel.regionBottomSheetType == RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER) { + bookAppointmentsViewModel.getRegionMappedProjectList(); + } else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) { + bookAppointmentsViewModel.getMappedDoctors(); + } + + // bookAppointmentsViewModel.getRegionMappedProjectList(); } } diff --git a/lib/presentation/book_appointment/widgets/appointment_calendar.dart b/lib/presentation/book_appointment/widgets/appointment_calendar.dart index 57a045cc..56bffc38 100644 --- a/lib/presentation/book_appointment/widgets/appointment_calendar.dart +++ b/lib/presentation/book_appointment/widgets/appointment_calendar.dart @@ -99,12 +99,12 @@ class _AppointmentCalendarState extends State { showNavigationArrow: true, headerHeight: 60.h, headerStyle: CalendarHeaderStyle( - backgroundColor: AppColors.scaffoldBgColor, + backgroundColor: AppColors.transparent, textAlign: TextAlign.start, textStyle: TextStyle(fontSize: 18.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.primaryRedColor, fontFamily: "Poppins"), ), viewHeaderStyle: ViewHeaderStyle( - backgroundColor: AppColors.scaffoldBgColor, + // backgroundColor: AppColors.scaffoldBgColor, dayTextStyle: TextStyle(fontSize: 14.f, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: AppColors.textColor, fontFamily: "Poppins"), ), view: CalendarView.month, diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index 02b2e55d..25856829 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -127,23 +127,23 @@ class DoctorCard extends StatelessWidget { spacing: 3.h, runSpacing: 4.h, children: [ - AppCustomChipWidget( - labelText: "${isLoading ? "Cardiologist" : doctorsListResponseModel.clinicName}", - ).toShimmer2(isShow: isLoading), - AppCustomChipWidget( - labelText: "${isLoading ? "Olaya Hospital" : doctorsListResponseModel.projectName}", - ).toShimmer2(isShow: isLoading), bookAppointmentsViewModel.isNearestAppointmentSelected ? doctorsListResponseModel.nearestFreeSlot != null ? AppCustomChipWidget( - // labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), - richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)) - .toText10(isEnglishOnly: true, color: AppColors.whiteColor), - backgroundColor: AppColors.successColor, - textColor: AppColors.whiteColor, + labelText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)), + // richText: (isLoading ? "Cardiologist" : DateUtil.getDateStringForNearestSlot(doctorsListResponseModel.nearestFreeSlot)) + // .toText10(isEnglishOnly: true, color: AppColors.textColor), + // backgroundColor: AppColors.successColor, + textColor: AppColors.textColor, ).toShimmer2(isShow: isLoading) : SizedBox.shrink() : SizedBox.shrink(), + AppCustomChipWidget( + labelText: "${isLoading ? "Cardiologist" : doctorsListResponseModel.clinicName}", + ).toShimmer2(isShow: isLoading), + AppCustomChipWidget( + labelText: "${isLoading ? "Olaya Hospital" : doctorsListResponseModel.projectName}", + ).toShimmer2(isShow: isLoading), ], ), ], @@ -155,7 +155,7 @@ class DoctorCard extends StatelessWidget { ), ], ), - SizedBox(height: 12.h), + SizedBox(height: 16.h), CustomButton( text: LocaleKeys.bookAppo.tr(context: context), onPressed: () async { diff --git a/lib/presentation/emergency_services/emergency_services_page.dart b/lib/presentation/emergency_services/emergency_services_page.dart index 7970d819..74fddc16 100644 --- a/lib/presentation/emergency_services/emergency_services_page.dart +++ b/lib/presentation/emergency_services/emergency_services_page.dart @@ -12,6 +12,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/RRT/rrt_request_type_select.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/ambulance_option_selection_bottomsheet.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/pickup_location.dart'; +import 'package:hmg_patient_app_new/presentation/emergency_services/er_online_checkin/er_online_checkin_home.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/history/er_history_listing.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; @@ -284,64 +285,67 @@ class EmergencyServicesPage extends StatelessWidget { Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), ], ).onPress(() { - showCommonBottomSheetWithoutHeight( - context, - child: Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.primaryRedColor, borderRadius: 24.h), - child: Padding( - padding: EdgeInsets.all(24.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - "".toText14(), - Utils.buildSvgWithAssets( - icon: AppAssets.cancel_circle_icon, - iconColor: AppColors.whiteColor, - width: 24.h, - height: 24.h, - fit: BoxFit.contain, - ).onPress(() { + if (emergencyServicesViewModel.patientHasAdvanceERBalance) { + Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome())); + } else { + showCommonBottomSheetWithoutHeight( + context, + child: Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.primaryRedColor, borderRadius: 24.h), + child: Padding( + padding: EdgeInsets.all(24.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + "".toText14(), + Utils.buildSvgWithAssets( + icon: AppAssets.cancel_circle_icon, + iconColor: AppColors.whiteColor, + width: 24.h, + height: 24.h, + fit: BoxFit.contain, + ).onPress(() { + Navigator.of(context).pop(); + }), + ], + ), + Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), + SizedBox(height: 8.h), + LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), + SizedBox(height: 8.h), + LocaleKeys.areYouSureYouWantToMakeERCheckIn.tr().toText14(color: Colors.white, weight: FontWeight.w500), + SizedBox(height: 24.h), + CustomButton( + text: LocaleKeys.confirm.tr(context: context), + onPressed: () async { Navigator.of(context).pop(); - }), - ], - ), - Lottie.asset(AppAnimations.ambulanceAlert, - repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), - SizedBox(height: 8.h), - LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), - SizedBox(height: 8.h), - LocaleKeys.areYouSureYouWantToMakeERCheckIn.tr().toText14(color: Colors.white, weight: FontWeight.w500), - SizedBox(height: 24.h), - CustomButton( - text: LocaleKeys.confirm.tr(context: context), - onPressed: () async { - Navigator.of(context).pop(); - LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingYourERAppointmentStatus.tr()); - await context.read().checkPatientERAdvanceBalance(onSuccess: (dynamic response) { - LoaderBottomSheet.hideLoader(); - context.read().navigateToEROnlineCheckIn(); - }); - }, - backgroundColor: Colors.white, - borderColor: Colors.white, - textColor: AppColors.primaryRedColor, - icon: AppAssets.checkmark_icon, - iconColor: AppColors.primaryRedColor, - ), - SizedBox(height: 8.h), - ], + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingYourERAppointmentStatus.tr()); + await context.read().checkPatientERAdvanceBalance(onSuccess: (dynamic response) { + LoaderBottomSheet.hideLoader(); + context.read().navigateToEROnlineCheckIn(); + }); + }, + backgroundColor: Colors.white, + borderColor: Colors.white, + textColor: AppColors.primaryRedColor, + icon: AppAssets.checkmark_icon, + iconColor: AppColors.primaryRedColor, + ), + SizedBox(height: 8.h), + ], + ), ), ), - ), - isFullScreen: false, - isCloseButtonVisible: false, - hasBottomPadding: false, - backgroundColor: AppColors.primaryRedColor, - callBackFunc: () {}, - ); + isFullScreen: false, + isCloseButtonVisible: false, + hasBottomPadding: false, + backgroundColor: AppColors.primaryRedColor, + callBackFunc: () {}, + ); + } }), ), ], diff --git a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_details_page.dart b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_details_page.dart index 463121d9..eee31da7 100644 --- a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_details_page.dart +++ b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_details_page.dart @@ -128,7 +128,7 @@ class ErOnlineCheckinPaymentDetailsPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - width: 150.h, + width: 200.h, child: Utils.getPaymentMethods(), ), Row( diff --git a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart index 8b9633c1..bc0e7344 100644 --- a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart +++ b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart @@ -468,12 +468,12 @@ class _ErOnlineCheckinPaymentPageState extends State context, child: Utils.getErrorWidget(loadingText: LocaleKeys.paymentFailedPleaseTryAgain.tr(context: context)), callBackFunc: () { - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); + // Navigator.pushAndRemoveUntil( + // context, + // CustomPageRoute( + // page: LandingNavigation(), + // ), + // (r) => false); }, isFullScreen: false, isCloseButtonVisible: true, diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 14684c0c..62707ab4 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -498,67 +498,67 @@ class _LandingPageState extends State { ), // Consumer for ER Online Check-In pending request - Consumer( - builder: (context, emergencyServicesVM, child) { - return emergencyServicesVM.patientHasAdvanceERBalance - ? Column( - children: [ - SizedBox(height: 16.h), - Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 20.r, - hasShadow: false, - side: BorderSide(color: AppColors.primaryRedColor, width: 3.h), - ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.all(16.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // AppCustomChipWidget( - // labelText: LocaleKeys.erOnlineCheckInRequest.tr(context: context), - // backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.10), - // textColor: AppColors.primaryRedColor, - // ), - // Utils.buildSvgWithAssets(icon: AppAssets.appointment_checkin_icon, width: 24.h, height: 24.h, iconColor: AppColors.primaryRedColor), - // ], - // ), - SizedBox(height: 8.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - LocaleKeys.youHaveEROnlineCheckInRequest.tr(context: context).toText12(isBold: true), - Transform.flip( - flipX: getIt.get().isArabic(), - child: Utils.buildSvgWithAssets( - icon: AppAssets.forward_arrow_icon_small, - iconColor: AppColors.blackColor, - width: 20.h, - height: 15.h, - fit: BoxFit.contain, - ), - ), - ], - ), - ], - ), - ), - ).paddingSymmetrical(24.h, 0.h).onPress(() { - Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome())); - // context.read().navigateToEROnlineCheckIn(); - }), - SizedBox(height: 12.h), - ], - ) - : SizedBox(height: 0.h); - }, - ), - SizedBox(height: 16.h), + // Consumer( + // builder: (context, emergencyServicesVM, child) { + // return emergencyServicesVM.patientHasAdvanceERBalance + // ? Column( + // children: [ + // SizedBox(height: 16.h), + // Container( + // decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + // color: AppColors.whiteColor, + // borderRadius: 20.r, + // hasShadow: false, + // side: BorderSide(color: AppColors.primaryRedColor, width: 3.h), + // ), + // width: double.infinity, + // child: Padding( + // padding: EdgeInsets.all(16.h), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // // Row( + // // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // // children: [ + // // AppCustomChipWidget( + // // labelText: LocaleKeys.erOnlineCheckInRequest.tr(context: context), + // // backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.10), + // // textColor: AppColors.primaryRedColor, + // // ), + // // Utils.buildSvgWithAssets(icon: AppAssets.appointment_checkin_icon, width: 24.h, height: 24.h, iconColor: AppColors.primaryRedColor), + // // ], + // // ), + // SizedBox(height: 8.h), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // LocaleKeys.youHaveEROnlineCheckInRequest.tr(context: context).toText12(isBold: true), + // Transform.flip( + // flipX: getIt.get().isArabic(), + // child: Utils.buildSvgWithAssets( + // icon: AppAssets.forward_arrow_icon_small, + // iconColor: AppColors.blackColor, + // width: 20.h, + // height: 15.h, + // fit: BoxFit.contain, + // ), + // ), + // ], + // ), + // ], + // ), + // ), + // ).paddingSymmetrical(24.h, 0.h).onPress(() { + // Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome())); + // // context.read().navigateToEROnlineCheckIn(); + // }), + // SizedBox(height: 12.h), + // ], + // ) + // : SizedBox(height: 0.h); + // }, + // ), + SizedBox(height: 16.h), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/presentation/home/widgets/habib_wallet_card.dart b/lib/presentation/home/widgets/habib_wallet_card.dart index 0ac32443..19c03284 100644 --- a/lib/presentation/home/widgets/habib_wallet_card.dart +++ b/lib/presentation/home/widgets/habib_wallet_card.dart @@ -115,7 +115,7 @@ class HabibWalletCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - width: 150.h, + width: 200.h, child: Utils.getPaymentMethods(), ), CustomButton( diff --git a/lib/presentation/prescriptions/prescription_item_view.dart b/lib/presentation/prescriptions/prescription_item_view.dart index 1c145115..13ddebf1 100644 --- a/lib/presentation/prescriptions/prescription_item_view.dart +++ b/lib/presentation/prescriptions/prescription_item_view.dart @@ -207,7 +207,7 @@ class PrescriptionItemView extends StatelessWidget { initialHour: DateTime.now().hour, initialMinute: DateTime.now().minute, use24HourFormat: true, - pickerHeight: 120.h, + pickerHeight: 200.h, itemExtent: 100.h, onTimeChanged: (time) { // Handle selected time diff --git a/lib/presentation/prescriptions/prescription_reminder_view.dart b/lib/presentation/prescriptions/prescription_reminder_view.dart index aab587d4..d1dcd07a 100644 --- a/lib/presentation/prescriptions/prescription_reminder_view.dart +++ b/lib/presentation/prescriptions/prescription_reminder_view.dart @@ -20,7 +20,7 @@ class PrescriptionReminderView extends StatefulWidget { } class _PrescriptionReminderViewState extends State { - final List _options = [15, 30, 60, 90]; + final List _options = [60, 360, 720, 1440]; int _selectedOption = 0; // Nullable to represent no selection initially @override @@ -54,7 +54,7 @@ class _PrescriptionReminderViewState extends State { ), child: RadioListTile( title: Text( - "${_options[index]} ${LocaleKeys.minute.tr(context: context)}", + "${(_options[index] / 60).toInt()} ${LocaleKeys.hours.tr(context: context)}", style: TextStyle( fontSize: 16.h, fontWeight: FontWeight.w500, diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index eb6b4800..cec865b3 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -260,7 +260,7 @@ class ProfileSettingsState extends State { ); }), 1.divider, - actionItem(AppAssets.language, LocaleKeys.preferredLanguage.tr(context: context), () { + actionItem(AppAssets.language, LocaleKeys.communicationLanguage.tr(context: context), () { profileVm.openPreferredLanguageBottomSheet(); }, trailingLabel: profileVm.isPatientProfileLoading diff --git a/lib/presentation/profile_settings/widgets/preferred_language_widget.dart b/lib/presentation/profile_settings/widgets/preferred_language_widget.dart index 789bb284..dcd30360 100644 --- a/lib/presentation/profile_settings/widgets/preferred_language_widget.dart +++ b/lib/presentation/profile_settings/widgets/preferred_language_widget.dart @@ -41,7 +41,7 @@ class _PreferredLanguageWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, spacing: 24.h, children: [ - LocaleKeys.languageSetting.tr(context: context).toText14(), + LocaleKeys.communicationLanguage.tr(context: context).toText14(), Container( padding: EdgeInsets.only(top: 4, bottom: 4), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), diff --git a/lib/presentation/todo_section/ancillary_procedures_details_page.dart b/lib/presentation/todo_section/ancillary_procedures_details_page.dart index 38d4f978..ef1aba72 100644 --- a/lib/presentation/todo_section/ancillary_procedures_details_page.dart +++ b/lib/presentation/todo_section/ancillary_procedures_details_page.dart @@ -640,7 +640,7 @@ class _AncillaryOrderDetailsListState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SizedBox( - width: 150.h, + width: 200.h, child: Utils.getPaymentMethods(), ), Row( diff --git a/lib/widgets/scroll_wheel_time_picker.dart b/lib/widgets/scroll_wheel_time_picker.dart index a6e155bb..e1a35d6f 100644 --- a/lib/widgets/scroll_wheel_time_picker.dart +++ b/lib/widgets/scroll_wheel_time_picker.dart @@ -115,18 +115,21 @@ class _ScrollWheelTimePickerState extends State { widget.use24HourFormat ? index : index + 1; final isSelected = hour == _selectedHour; return Visibility( - visible: isSelected, - child: Center( - child: AnimatedDefaultTextStyle( + visible: true, + child: Center( + child: AnimatedDefaultTextStyle( duration: const Duration(milliseconds: 200), style: digitStyle.copyWith( color: isSelected ? AppColors.textColor : AppColors.textColor.withValues(alpha: 0.3), ), - child: Text(hour.toString().padLeft(2, '0')), + child: Text( + hour.toString().padLeft(2, '0'), + ), + ), ), - )); + ); }, ), ), @@ -157,8 +160,8 @@ class _ScrollWheelTimePickerState extends State { builder: (context, index) { final isSelected = index == _selectedMinute; return Visibility( - visible: isSelected, - child: + visible: true, + child: Center( child: AnimatedDefaultTextStyle( duration: const Duration(milliseconds: 200),