diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 78814f4e..f9cc3035 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -365,7 +365,7 @@ "paymentOnline": "الخدمة", "onlineCheckIn": "تسجيل الوصول عبر الإنترنت", "myBalances": "رصيدي", - "myWallet": "محف��تي", + "myWallet": "محفظتي", "balanceAmount": "مبلغ المحفظة", "totalBalance": "إجمالي الرصيد", "createAdvancedPayment": "إعادة شحن المحفظة", @@ -489,7 +489,7 @@ "services2": "الخدمات", "cantSeeProfile": "لرؤية ملفك الطبي، يرجى تسجيل الدخول أو التسجيل الآن", "loginRegisterNow": "تسجيل الدخول أو التسجيل الآن", - "hmgPharmacy": "صيدلية مجموعة الحبيب الطبية", + "hmgPharmacy": "صيدلية الحبيب", "ecommerceSolution": "حلول التجارة الإلكترونية", "comprehensive": "شامل", "onlineConsulting": "استشارات عبر الإنترنت", @@ -860,7 +860,7 @@ "onboardingBody1": "ببضع نقرات فقط يمكنك استشارة الطبيب الذي تختاره.", "onboardingHeading2": "الوصول إلى السجل الطبي بين يديك", "onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها.", - "hmgHospitals": "مستشفيات مجموعة الحبيب الطبية", + "hmgHospitals": "مستشفيات الحبيب", "hmcMedicalClinic": "مراكز مجموعة الحبيب الطبية", "applyFilter": "تطبيق الفلتر", "facilityAndLocation": "المرفق والموقع", diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 1f09cdfd..18a8d6c8 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -152,9 +152,11 @@ class Utils { static String getDayMonthYearDateFormatted(DateTime? dateTime) { if (dateTime == null) return ""; - return appState.isArabic() - ? "${dateTime.day.toString()} ${getMonthArabic(dateTime.month)}, ${dateTime.year.toString()}" - : "${dateTime.day.toString()} ${getMonth(dateTime.month)}, ${dateTime.year.toString()}"; + return + // appState.isArabic() + // ? "${dateTime.day.toString()} ${getMonthArabic(dateTime.month)}, ${dateTime.year.toString()}" + // : + "${dateTime.day.toString()} ${getMonth(dateTime.month)}, ${dateTime.year.toString()}"; } /// get month by diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 407380c1..a68bdcf1 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -296,10 +296,11 @@ extension EmailValidator on String { style: TextStyle(height: 1, color: color ?? AppColors.blackColor, fontSize: 22.f, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), ); - Widget toText24({Color? color, bool isBold = false, bool isCenter = false, FontWeight? fontWeight, double? letterSpacing}) => Text( + Widget toText24({Color? color, bool isBold = false, bool isCenter = false, FontWeight? fontWeight, double? letterSpacing, bool isEnglishOnly = false,}) => Text( this, textAlign: isCenter ? TextAlign.center : null, style: TextStyle( + fontFamily: (isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'), height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.f, letterSpacing: letterSpacing ?? -1, fontWeight: isBold ? FontWeight.bold : fontWeight ?? FontWeight.normal), ); diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 9d36d5df..327afeb0 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -153,6 +153,72 @@ class BookAppointmentsViewModel extends ChangeNotifier { AppointmentNearestGateResponseModel? appointmentNearestGateResponseModel; ///variables for laser clinic + bool isLaserHospitalsLoading = false; + List laserHospitalsList = []; + int laserHospitalHmgCount = 0; + int laserHospitalHmcCount = 0; + + Future getLaserHospitals({Function(dynamic)? onSuccess, Function(String)? onError}) async { + isLaserHospitalsLoading = true; + laserHospitalsList.clear(); + laserHospitalHmgCount = 0; + laserHospitalHmcCount = 0; + notifyListeners(); + + final result = await bookAppointmentsRepo.getDoctorsList(253, 0, false, 0, ''); + + result.fold( + (failure) async { + isLaserHospitalsLoading = false; + notifyListeners(); + onError?.call(failure.message); + }, + (apiResponse) async { + if (apiResponse.messageStatus == 1) { + var doctorList = apiResponse.data!; + var regionList = await DoctorMapper.getMappedDoctor( + doctorList, + isArabic: _appState.isArabic(), + lat: _appState.userLat, + long: _appState.userLong, + ); + + var isLocationEnabled = (_appState.userLat != 0) && (_appState.userLong != 0); + regionList = await DoctorMapper.sortList(isLocationEnabled, regionList); + + // Flatten all hospitals across all regions into a single list + laserHospitalsList.clear(); + Set addedHospitals = {}; + regionList.registeredDoctorMap?.forEach((region, regionData) { + for (var hospital in regionData?.hmgDoctorList ?? []) { + if (!addedHospitals.contains(hospital.filterName)) { + addedHospitals.add(hospital.filterName ?? ''); + laserHospitalsList.add(hospital); + } + } + for (var hospital in regionData?.hmcDoctorList ?? []) { + if (!addedHospitals.contains(hospital.filterName)) { + addedHospitals.add(hospital.filterName ?? ''); + laserHospitalsList.add(hospital); + } + } + }); + + laserHospitalHmgCount = laserHospitalsList.where((h) => h.isHMC != true).length; + laserHospitalHmcCount = laserHospitalsList.where((h) => h.isHMC == true).length; + + isLaserHospitalsLoading = false; + notifyListeners(); + onSuccess?.call(apiResponse); + } else { + isLaserHospitalsLoading = false; + notifyListeners(); + onError?.call(apiResponse.errorMessage ?? 'Unknown error'); + } + }, + ); + } + List femaleLaserCategory = [ LaserCategoryType(1, 'bodyString'), LaserCategoryType(2, 'face'), diff --git a/lib/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart b/lib/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart index e1ae67d6..c0da3c47 100644 --- a/lib/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart +++ b/lib/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart @@ -73,6 +73,7 @@ class PatientAppointmentHistoryResponseModel { num? patientShare; num? patientShareWithTax; num? patientTaxAmount; + String? doctorNationalityFlagURL; PatientAppointmentHistoryResponseModel({ this.setupID, @@ -148,6 +149,7 @@ class PatientAppointmentHistoryResponseModel { this.patientShare, this.patientShareWithTax, this.patientTaxAmount, + this.doctorNationalityFlagURL, }); PatientAppointmentHistoryResponseModel.fromJson(Map json) { @@ -235,6 +237,7 @@ class PatientAppointmentHistoryResponseModel { patientShare = json['PatientShare']; patientShareWithTax = json['PatientShareWithTax']; patientTaxAmount = json['PatientTaxAmount']; + doctorNationalityFlagURL = json['DoctorNationalityFlagURL']; } Map toJson() { diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index c120a323..679c4bac 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -165,7 +165,16 @@ class AppointmentCard extends StatelessWidget { children: [ (isLoading ? 'Dr' : "${patientAppointmentHistoryResponseModel.doctorTitle}").toText16(isBold: true, maxlines: 1), (isLoading ? 'John Doe' : " ${patientAppointmentHistoryResponseModel.doctorNameObj!.truncate(20)}") - .toText16(isBold: true, maxlines: 1, isEnglishOnly: !Utils.isArabicText(patientAppointmentHistoryResponseModel.doctorNameObj ?? "John Doe")) + .toText16(isBold: true, maxlines: 1, isEnglishOnly: !Utils.isArabicText(patientAppointmentHistoryResponseModel.doctorNameObj ?? "John Doe")), + SizedBox(width: 12.w), + (patientAppointmentHistoryResponseModel.doctorNationalityFlagURL != null && patientAppointmentHistoryResponseModel.doctorNationalityFlagURL!.isNotEmpty) + ? Image.network( + patientAppointmentHistoryResponseModel.doctorNationalityFlagURL ?? "https://hmgwebservices.com/Images/flag/SAU.png", + width: 20.h, + height: 15.h, + fit: BoxFit.cover, + ) + : SizedBox.shrink(), ], ).toShimmer2(isShow: isLoading), SizedBox(height: 8.h), diff --git a/lib/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart b/lib/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart index 95fc09b8..2acc076e 100644 --- a/lib/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart +++ b/lib/presentation/appointments/widgets/appointment_checkin_bottom_sheet.dart @@ -71,20 +71,20 @@ class AppointmentCheckinBottomSheet extends StatelessWidget { } }); }), - SizedBox(height: 16.h), - checkInOptionCard( - AppAssets.checkin_nfc_icon, - LocaleKeys.nfcNearFieldCommunication.tr(context: context), - LocaleKeys.scanPhoneViaNFC.tr(context: context), - ).onPress(() { - Future.delayed(const Duration(milliseconds: 500), () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendCheckInRequest(nfcId, 1, context); - }); - }, onCancel: () {}); - }); - }), + // SizedBox(height: 16.h), + // checkInOptionCard(O + // AppAssets.checkin_nfc_icon, + // LocaleKeys.nfcNearFieldCommunication.tr(context: context), + // LocaleKeys.scanPhoneViaNFC.tr(context: context), + // ).onPress(() { + // Future.delayed(const Duration(milliseconds: 500), () { + // showNfcReader(context, onNcfScan: (String nfcId) { + // Future.delayed(const Duration(milliseconds: 100), () { + // sendCheckInRequest(nfcId, 1, context); + // }); + // }, onCancel: () {}); + // }); + // }), SizedBox(height: 16.h), checkInOptionCard( AppAssets.checkin_qr_icon, diff --git a/lib/presentation/appointments/widgets/appointment_doctor_card.dart b/lib/presentation/appointments/widgets/appointment_doctor_card.dart index 11619b5f..f00284c0 100644 --- a/lib/presentation/appointments/widgets/appointment_doctor_card.dart +++ b/lib/presentation/appointments/widgets/appointment_doctor_card.dart @@ -87,7 +87,20 @@ class AppointmentDoctorCard extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true, isEnglishOnly: !Utils.isArabicText(patientAppointmentHistoryResponseModel.doctorNameObj ?? "")), + Row( + children: [ + patientAppointmentHistoryResponseModel.doctorNameObj!.toText16(isBold: true, isEnglishOnly: !Utils.isArabicText(patientAppointmentHistoryResponseModel.doctorNameObj ?? "")), + SizedBox(width: 12.w), + (patientAppointmentHistoryResponseModel.doctorNationalityFlagURL != null && patientAppointmentHistoryResponseModel.doctorNationalityFlagURL!.isNotEmpty) + ? Image.network( + patientAppointmentHistoryResponseModel.doctorNationalityFlagURL ?? "https://hmgwebservices.com/Images/flag/SAU.png", + width: 20.h, + height: 15.h, + fit: BoxFit.cover, + ) + : SizedBox.shrink(), + ], + ), SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, diff --git a/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart b/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart index abe1641a..26b4526f 100644 --- a/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart +++ b/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart @@ -10,6 +10,8 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; +import 'dart:ui' as ui; + class HospitalListItem extends StatelessWidget { final PatientDoctorAppointmentList? hospitalData; final bool isLocationEnabled; @@ -76,12 +78,16 @@ class HospitalListItem extends StatelessWidget { children: [ Visibility( visible: (hospitalData?.distanceInKMs != "0"), - child: AppCustomChipWidget( - labelText: "${hospitalData?.distanceInKMs ?? ""} km", - deleteIcon: AppAssets.location_red, - deleteIconSize: Size(9, 12), - backgroundColor: AppColors.secondaryLightRedColor, - textColor: AppColors.errorColor, + child: Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: "${hospitalData?.distanceInKMs ?? ""} km", + deleteIcon: AppAssets.location_red, + deleteIconSize: Size(9, 12), + backgroundColor: AppColors.secondaryLightRedColor, + textColor: AppColors.errorColor, + isEnglishOnly: true, + ), ), ), Visibility( diff --git a/lib/presentation/book_appointment/select_clinic_page.dart b/lib/presentation/book_appointment/select_clinic_page.dart index 86d57ad2..6812a349 100644 --- a/lib/presentation/book_appointment/select_clinic_page.dart +++ b/lib/presentation/book_appointment/select_clinic_page.dart @@ -16,6 +16,8 @@ import 'package:hmg_patient_app_new/features/book_appointments/book_appointments import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_clinic_list_response_model.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/get_livecare_clinics_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.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/faculity_selection/facility_type_selection_widget.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/hospital_bottom_sheet/hospital_bottom_sheet_body.dart'; @@ -1027,6 +1029,7 @@ class _SelectClinicPageState extends State { //17 and 235 void handleDoctorScreen(GetClinicsListResponseModel clinic) async { + regionalViewModel.flush(); if (widget.isFromRegionFlow) { //Dental Clinic Flow if (clinic.clinicID == 17) { @@ -1061,8 +1064,22 @@ class _SelectClinicPageState extends State { ); } } else { + if (clinic.clinicID == 253) { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.loadingText.tr(context: context)); + await bookAppointmentsViewModel.getLaserHospitals( + onSuccess: (_) { + LoaderBottomSheet.hideLoader(); + _showLaserHospitalBottomSheet(); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + }, + ); + return; + } var bottomSheetType = RegionBottomSheetType.FOR_CLINIIC; - if (clinic.clinicID == 17 || clinic.clinicID == 253) { + if (clinic.clinicID == 17) { + regionalViewModel.setBottomSheetState(AppointmentViaRegionState.HOSPITAL_SELECTION); bottomSheetType = RegionBottomSheetType.REGION_FOR_DENTAL_AND_LASER; } openRegionListBottomSheet(context, bottomSheetType); @@ -1072,7 +1089,6 @@ class _SelectClinicPageState extends State { void openRegionListBottomSheet(BuildContext context, RegionBottomSheetType type) { bookAppointmentsViewModel.setProjectID(null); - regionalViewModel.flush(); regionalViewModel.setBottomSheetType(type); // AppointmentViaRegionViewmodel? viewmodel = null; showCommonBottomSheetWithoutHeight(context, title: "", titleWidget: Consumer(builder: (_, data, __) => getTitle(data)), isDismissible: false, @@ -1350,4 +1366,60 @@ class _SelectClinicPageState extends State { // bookAppointmentsViewModel.getRegionMappedProjectList(); } + + void _showLaserHospitalBottomSheet() { + final TextEditingController laserHospitalSearchController = TextEditingController(); + List filteredList = List.from(bookAppointmentsViewModel.laserHospitalsList); + + showCommonBottomSheetWithoutHeight( + context, + title: LocaleKeys.selectHospital.tr(context: context), + isDismissible: true, + isCloseButtonVisible: true, + child: StatefulBuilder( + builder: (context, setModalState) { + return HospitalBottomSheetBody( + searchText: laserHospitalSearchController, + displayList: filteredList, + selectedFacility: FacilitySelection.ALL, + hmcCount: bookAppointmentsViewModel.laserHospitalHmcCount, + hmgCount: bookAppointmentsViewModel.laserHospitalHmgCount, + sortByLocation: false, + onFacilityClicked: (facility) { + setModalState(() { + if (facility == FacilitySelection.ALL) { + filteredList = List.from(bookAppointmentsViewModel.laserHospitalsList); + } else if (facility == FacilitySelection.HMG) { + filteredList = bookAppointmentsViewModel.laserHospitalsList.where((h) => h.isHMC != true).toList(); + } else { + filteredList = bookAppointmentsViewModel.laserHospitalsList.where((h) => h.isHMC == true).toList(); + } + }); + }, + onHospitalClicked: (hospital) { + Navigator.of(context).pop(); // close bottom sheet + final projectID = hospital.hospitalList.isNotEmpty ? hospital.hospitalList.first.iD?.toString() : hospital.patientDoctorAppointmentList?.first.projectID?.toString(); + bookAppointmentsViewModel.setProjectID(projectID); + bookAppointmentsViewModel.resetLaserData(); + bookAppointmentsViewModel.getLaserClinic(); + Navigator.push( + context, + CustomPageRoute(page: LaserAppointment()), + ); + }, + onHospitalSearch: (value) { + setModalState(() { + if (value.isEmpty) { + filteredList = List.from(bookAppointmentsViewModel.laserHospitalsList); + } else { + filteredList = bookAppointmentsViewModel.laserHospitalsList.where((h) => h.filterName != null && h.filterName!.toLowerCase().contains(value.toLowerCase())).toList(); + } + }); + }, + ); + }, + ), + callBackFunc: () {}, + ); + } } diff --git a/lib/presentation/book_appointment/widgets/doctor_rating_details.dart b/lib/presentation/book_appointment/widgets/doctor_rating_details.dart index 17a3319b..c146820d 100644 --- a/lib/presentation/book_appointment/widgets/doctor_rating_details.dart +++ b/lib/presentation/book_appointment/widgets/doctor_rating_details.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.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'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; @@ -146,14 +147,27 @@ class DoctorRatingDialog extends StatelessWidget { color: averageRating == 0 || averageRating == 0.0 ? AppColors.greyF7Color : AppColors.textColor.withAlpha(20), borderRadius: BorderRadius.circular(8), ), - child: Text( - '${NumberFormat.decimalPattern().format(totalReviews)} ${LocaleKeys.reviews.tr(context: context)}', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: averageRating == 0 || averageRating == 0.0 ? AppColors.textColor : AppColors.whiteColor, - ), + child: Row( + children: [ + NumberFormat.decimalPattern().format(totalReviews).toText12( + fontWeight: FontWeight.w500, + color: averageRating == 0 || averageRating == 0.0 ? AppColors.textColor : AppColors.whiteColor, + isEnglishOnly: true + ), + ' ${LocaleKeys.reviews.tr(context: context)}'.toText12( + fontWeight: FontWeight.w500, + color: averageRating == 0 || averageRating == 0.0 ? AppColors.textColor : AppColors.whiteColor, + ), + ], ), + // child: Text( + // '${NumberFormat.decimalPattern().format(totalReviews)} ${LocaleKeys.reviews.tr(context: context)}', + // style: TextStyle( + // fontSize: 12.f, + // fontWeight: FontWeight.w500, + // color: averageRating == 0 || averageRating == 0.0 ? AppColors.textColor : AppColors.whiteColor, + // ), + // ), ), ], ), diff --git a/lib/presentation/contact_us/find_us_page.dart b/lib/presentation/contact_us/find_us_page.dart index 0cabbf2b..4b272f50 100644 --- a/lib/presentation/contact_us/find_us_page.dart +++ b/lib/presentation/contact_us/find_us_page.dart @@ -45,7 +45,7 @@ class FindUsPage extends StatelessWidget { activeBackgroundColor: AppColors.primaryRedColor.withValues(alpha: .1), tabs: [ CustomTabBarModel(null, LocaleKeys.hmgHospitals.tr()), - CustomTabBarModel(null, LocaleKeys.pharmaciesList.tr()), + CustomTabBarModel(null, LocaleKeys.hmgPharmacy.tr()), ], onTabChange: (index) { contactUsVM.setHMGHospitalsListSelected(index == 0); diff --git a/lib/presentation/contact_us/widgets/find_us_item_card.dart b/lib/presentation/contact_us/widgets/find_us_item_card.dart index 521775bc..1cc21939 100644 --- a/lib/presentation/contact_us/widgets/find_us_item_card.dart +++ b/lib/presentation/contact_us/widgets/find_us_item_card.dart @@ -18,6 +18,7 @@ import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:map_launcher/map_launcher.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'dart:ui' as ui; class FindUsItemCard extends StatelessWidget { FindUsItemCard({super.key, required this.getHMGLocationsModel}); @@ -57,13 +58,17 @@ class FindUsItemCard extends StatelessWidget { (getHMGLocationsModel.distanceInKilometers != 0 && contactUsViewModel.hasLocationEnabled) ? Column( children: [ - AppCustomChipWidget( - labelText: "${getHMGLocationsModel.distanceInKilometers ?? ""} km", - labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.w), - icon: AppAssets.location_red, - // iconColor: AppColors.primaryRedColor, - // backgroundColor: AppColors.secondaryLightRedColor, - // textColor: AppColors.errorColor, + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: "${getHMGLocationsModel.distanceInKilometers ?? ""} km", + labelPadding: EdgeInsetsDirectional.only(start: -4.h, end: 8.w), + icon: AppAssets.location_red, + isEnglishOnly: true, + // iconColor: AppColors.primaryRedColor, + // backgroundColor: AppColors.secondaryLightRedColor, + // textColor: AppColors.errorColor, + ), ), SizedBox( height: 16.h, diff --git a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_select_checkin_bottom_sheet.dart b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_select_checkin_bottom_sheet.dart index 3b2dc8ae..f4bbe3af 100644 --- a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_select_checkin_bottom_sheet.dart +++ b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_select_checkin_bottom_sheet.dart @@ -60,20 +60,20 @@ class ErOnlineCheckinSelectCheckinBottomSheet extends StatelessWidget { } }); }), - SizedBox(height: 16.h), - checkInOptionCard( - AppAssets.checkin_nfc_icon, - LocaleKeys.nfcNearFieldCommunication.tr(context: context), - LocaleKeys.scanPhoneViaNFC.tr(context: context), - ).onPress(() { - Future.delayed(const Duration(milliseconds: 500), () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendCheckInRequest(nfcId, context); - }); - }, onCancel: () {}); - }); - }), + // SizedBox(height: 16.h), + // checkInOptionCard( + // AppAssets.checkin_nfc_icon, + // LocaleKeys.nfcNearFieldCommunication.tr(context: context), + // LocaleKeys.scanPhoneViaNFC.tr(context: context), + // ).onPress(() { + // Future.delayed(const Duration(milliseconds: 500), () { + // showNfcReader(context, onNcfScan: (String nfcId) { + // Future.delayed(const Duration(milliseconds: 100), () { + // sendCheckInRequest(nfcId, context); + // }); + // }, onCancel: () {}); + // }); + // }), SizedBox(height: 16.h), checkInOptionCard( AppAssets.checkin_qr_icon, diff --git a/lib/presentation/emergency_services/history/er_history_listing.dart b/lib/presentation/emergency_services/history/er_history_listing.dart index a60d4556..d72200c5 100644 --- a/lib/presentation/emergency_services/history/er_history_listing.dart +++ b/lib/presentation/emergency_services/history/er_history_listing.dart @@ -23,7 +23,6 @@ class ErHistoryListing extends StatelessWidget { return Scaffold( body: Column( children: [ - Expanded( child: CollapsingListView( title: LocaleKeys.history.tr(context: context), @@ -31,15 +30,12 @@ class ErHistoryListing extends StatelessWidget { physics: NeverScrollableScrollPhysics(), child: Column( children: [ - Selector( selector: (context, vm) => (vm.orderDisplayList, vm.historyLoading), builder: (context, data, _) { - return Column( children: [ orderChips(context, data.$2, data.$1), - Visibility( visible:data.$1.isNotEmpty == true, child: ListView.builder( diff --git a/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart b/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart index e1ebc83c..100c0cfa 100644 --- a/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart +++ b/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart @@ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; import '../../../../core/utils/utils.dart'; @@ -37,11 +38,11 @@ class AmbulanceHistoryItem extends StatelessWidget { spacing: 8.h, children: [ RequestStatus(status: order.statusId ?? 0), - "Req ID: ${order.iD}".toText16(color: AppColors.textColor, weight: FontWeight.w600), + "Req ID: ${order.iD}".toText16(color: AppColors.textColor, weight: FontWeight.w600, isEnglishOnly: true), Row( spacing: 4.w, children: [ - chip( Utils.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.time)), AppAssets.calendar, AppColors.blackBgColor), + chip(Utils.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.time)), AppAssets.calendar, AppColors.blackBgColor), chip(LocaleKeys.ambulancerequest.tr(context: context), AppAssets.ambulance, AppColors.blackBgColor), ], ), @@ -71,11 +72,15 @@ class AmbulanceHistoryItem extends StatelessWidget { } chip(String title, String iconString, Color iconColor) { - return AppCustomChipWidget( - labelText: title, - icon: iconString, - iconColor: iconColor, - iconSize: 12.h, + return Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: title, + icon: iconString, + iconColor: iconColor, + iconSize: 12.h, + isEnglishOnly: true, + ), ); } diff --git a/lib/presentation/emergency_services/history/widget/rrt_item.dart b/lib/presentation/emergency_services/history/widget/rrt_item.dart index c8787791..8e910231 100644 --- a/lib/presentation/emergency_services/history/widget/rrt_item.dart +++ b/lib/presentation/emergency_services/history/widget/rrt_item.dart @@ -13,6 +13,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; import '../../../../core/utils/utils.dart'; @@ -37,11 +38,11 @@ class RRTItem extends StatelessWidget { spacing: 8.h, children: [ RequestStatus(status: order.statusId ?? 0), - "Req ID: ${order.iD}".toText16(color: AppColors.textColor, weight: FontWeight.w600), + "Req ID: ${order.iD}".toText16(color: AppColors.textColor, weight: FontWeight.w600, isEnglishOnly: true), Row( spacing: 4.w, children: [ - chip( Utils.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.time)), AppAssets.calendar, AppColors.blackBgColor), + chip(Utils.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.time)), AppAssets.calendar, AppColors.blackBgColor), chip(LocaleKeys.rapidResponseTeam.tr(context: context), AppAssets.ic_rrt_vehicle, AppColors.blackBgColor), ], ), @@ -65,11 +66,15 @@ class RRTItem extends StatelessWidget { } chip(String title, String iconString, Color iconColor) { - return AppCustomChipWidget( - labelText: title, - icon: iconString, - iconColor: iconColor, - iconSize: 12.h, + return Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: title, + icon: iconString, + iconColor: iconColor, + iconSize: 12.h, + isEnglishOnly: true, + ), ); } diff --git a/lib/presentation/emergency_services/widgets/nearestERItem.dart b/lib/presentation/emergency_services/widgets/nearestERItem.dart index 0c4a5a6a..423b887e 100644 --- a/lib/presentation/emergency_services/widgets/nearestERItem.dart +++ b/lib/presentation/emergency_services/widgets/nearestERItem.dart @@ -13,6 +13,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; + class NearestERItem extends StatelessWidget { final ProjectAvgERWaitingTime nearestERItem; final bool isLoading; @@ -68,20 +70,28 @@ class NearestERItem extends StatelessWidget { Row( spacing: 8.h, children: [ - AppCustomChipWidget( - labelText: "${nearestERItem.distanceInKilometers} km", - icon: AppAssets.location, - iconHasColor: false, - labelPadding: EdgeInsetsDirectional.only(start: 4.h, end: 0.h), - padding: EdgeInsets.all(8.h), - ).toShimmer2(isShow: isLoading), - AppCustomChipWidget( - labelText: "Expected waiting time: ${nearestERItem.getTime()} mins", - icon: AppAssets.waiting_time_clock, - iconHasColor: false, - labelPadding: EdgeInsetsDirectional.only(start: 4.h, end: 0.h), - padding: EdgeInsets.all(8.h), - ).toShimmer2(isShow: isLoading), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: "${nearestERItem.distanceInKilometers} km", + icon: AppAssets.location, + iconHasColor: false, + labelPadding: EdgeInsetsDirectional.only(start: 4.h, end: 0.h), + padding: EdgeInsets.all(8.h), + isEnglishOnly: true, + ).toShimmer2(isShow: isLoading), + ), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: "Expected waiting time: ${nearestERItem.getTime()} mins", + icon: AppAssets.waiting_time_clock, + iconHasColor: false, + labelPadding: EdgeInsetsDirectional.only(start: 4.h, end: 0.h), + padding: EdgeInsets.all(8.h), + isEnglishOnly: true, + ).toShimmer2(isShow: isLoading), + ), ], ), SizedBox(height: 16.h), diff --git a/lib/presentation/habib_wallet/habib_wallet_page.dart b/lib/presentation/habib_wallet/habib_wallet_page.dart index 700f421f..2cdfc8b6 100644 --- a/lib/presentation/habib_wallet/habib_wallet_page.dart +++ b/lib/presentation/habib_wallet/habib_wallet_page.dart @@ -74,7 +74,7 @@ class _HabibWalletState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ "${_appState.getAuthenticatedUser()!.firstName!} ${_appState.getAuthenticatedUser()!.lastName!}".toText19(isBold: true, color: Colors.white), - "MRN: ${_appState.getAuthenticatedUser()!.patientId!}".toText14(weight: FontWeight.w500, color: AppColors.greyTextColor), + "MRN: ${_appState.getAuthenticatedUser()!.patientId!}".toText14(weight: FontWeight.w500, color: AppColors.greyTextColor, isEnglishOnly: true), ], ).expanded, Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, width: 24.h, height: 24.h, applyThemeColor: false), diff --git a/lib/presentation/habib_wallet/recharge_wallet_page.dart b/lib/presentation/habib_wallet/recharge_wallet_page.dart index ef1642eb..74c0a69d 100644 --- a/lib/presentation/habib_wallet/recharge_wallet_page.dart +++ b/lib/presentation/habib_wallet/recharge_wallet_page.dart @@ -140,7 +140,7 @@ class _RechargeWalletPageState extends State { children: [ (habibWalletVM.getSelectedRechargeTypeValue()).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), "${LocaleKeys.medicalFile.tr(context: context)}: ${habibWalletVM.fileNumber}" - .toText14(color: AppColors.textColor, weight: FontWeight.w500, letterSpacing: -0.2), + .toText14(color: AppColors.textColor, weight: FontWeight.w500, letterSpacing: -0.2, isEnglishOnly: true), ], ), ], @@ -203,7 +203,7 @@ class _RechargeWalletPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.email.tr(context: context).toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), - "${appState.getAuthenticatedUser()!.emailAddress}".toText14(color: AppColors.textColor, weight: FontWeight.w500, letterSpacing: -0.2), + "${appState.getAuthenticatedUser()!.emailAddress}".toText14(color: AppColors.textColor, weight: FontWeight.w500, letterSpacing: -0.2, isEnglishOnly: true), ], ), ], diff --git a/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart b/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart index 066e90cf..151b3f21 100644 --- a/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart +++ b/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart @@ -62,7 +62,7 @@ class _WalletPaymentConfirmPageState extends State { children: [ Expanded( child: CollapsingListView( - title: "Select Payment Method", + title: LocaleKeys.selectPaymentOption.tr(context: context), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -169,9 +169,17 @@ class _WalletPaymentConfirmPageState extends State { spacing: 4.h, runSpacing: 4.h, children: [ - AppCustomChipWidget(labelText: "${LocaleKeys.fileno.tr(context: context)}.: ${habibWalletVM.fileNumber}"), - AppCustomChipWidget(labelText: "${LocaleKeys.mobileNumber.tr(context: context)}: ${habibWalletVM.mobileNumber}"), - AppCustomChipWidget(labelText: "${habibWalletVM.selectedHospital!.name}"), + AppCustomChipWidget( + labelText: "${LocaleKeys.fileno.tr(context: context)}.: ${habibWalletVM.fileNumber}", + isEnglishOnly: true, + ), + AppCustomChipWidget( + labelText: "${LocaleKeys.mobileNumber.tr(context: context)}: ${habibWalletVM.mobileNumber}", + isEnglishOnly: true, + ), + AppCustomChipWidget( + labelText: "${habibWalletVM.selectedHospital!.name}", + ), ], ).paddingSymmetrical(24.h, 0.h), SizedBox(height: 16.h), @@ -181,7 +189,9 @@ class _WalletPaymentConfirmPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ LocaleKeys.totalAmountToPay.tr(context: context).toText16(isBold: true), - Utils.getPaymentAmountWithSymbol(habibWalletVM.walletRechargeAmount.toString().toText24(isBold: true), AppColors.blackColor, 15.h, isSaudiCurrency: true), + Utils.getPaymentAmountWithSymbol( + NumberFormat.decimalPattern().format(habibWalletVM.walletRechargeAmount).toString().toText24(isBold: true, isEnglishOnly: true), AppColors.blackColor, 15.h, + isSaudiCurrency: true), ], ).paddingSymmetrical(24.h, 0.h), SizedBox(height: 12.h), diff --git a/lib/presentation/health_calculators_and_converts/health_calculators_page.dart b/lib/presentation/health_calculators_and_converts/health_calculators_page.dart index 4f519d66..0b844b4f 100644 --- a/lib/presentation/health_calculators_and_converts/health_calculators_page.dart +++ b/lib/presentation/health_calculators_and_converts/health_calculators_page.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.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/enums.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -57,7 +58,9 @@ class _HealthCalculatorsPageState extends State { SizedBox( width: 12.w, ), - Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, width: 24.w, height: 24.h, fit: BoxFit.contain, iconColor: AppColors.textColor), + Transform.flip( + flipX: getIt.get().isArabic(), + child: Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, width: 24.w, height: 24.h, fit: BoxFit.contain, iconColor: AppColors.textColor)), ], ).paddingAll(16.w)) .onPress(() { @@ -86,7 +89,9 @@ class _HealthCalculatorsPageState extends State { ), ), SizedBox(width: 12.w), - Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, width: 24.w, height: 24.h, fit: BoxFit.contain, iconColor: AppColors.textColor), + Transform.flip( + flipX: getIt.get().isArabic(), + child: Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, width: 24.w, height: 24.h, fit: BoxFit.contain, iconColor: AppColors.textColor)), ], ).paddingAll(16.w)) .onPress(() { diff --git a/lib/presentation/health_trackers/health_trackers_page.dart b/lib/presentation/health_trackers/health_trackers_page.dart index 66630f28..ae57f7db 100644 --- a/lib/presentation/health_trackers/health_trackers_page.dart +++ b/lib/presentation/health_trackers/health_trackers_page.dart @@ -2,6 +2,8 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.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/enums.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/route_extensions.dart'; @@ -56,12 +58,15 @@ Widget buildHealthTrackerCard({ ), ), SizedBox(width: 12.w), - Utils.buildSvgWithAssets( - icon: AppAssets.arrowRight, - width: 24.w, - height: 24.h, - fit: BoxFit.contain, - iconColor: AppColors.textColor, + Transform.flip( + flipX: getIt.get().isArabic(), + child: Utils.buildSvgWithAssets( + icon: AppAssets.arrowRight, + width: 24.w, + height: 24.h, + fit: BoxFit.contain, + iconColor: AppColors.textColor, + ), ), ], ).paddingAll(16.w), diff --git a/lib/presentation/insurance/insurance_approval_details_page.dart b/lib/presentation/insurance/insurance_approval_details_page.dart index 7a69e088..e163b649 100644 --- a/lib/presentation/insurance/insurance_approval_details_page.dart +++ b/lib/presentation/insurance/insurance_approval_details_page.dart @@ -16,6 +16,8 @@ import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; + class InsuranceApprovalDetailsPage extends StatelessWidget { InsuranceApprovalDetailsPage({super.key, required this.insuranceApprovalResponseModel}); @@ -36,7 +38,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { decoration: RoundedRectangleBorder().toSmoothCornerDecoration( color: AppColors.whiteColor, borderRadius: 24.h, - hasShadow: true, + hasShadow: false, ), child: Padding( padding: EdgeInsets.all(14.h), @@ -84,21 +86,42 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ (insuranceApprovalResponseModel.doctorName!).toText16(isBold: true), + SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, spacing: 3.h, runSpacing: 4.h, children: [ AppCustomChipWidget(labelText: insuranceApprovalResponseModel.clinicName!), - AppCustomChipWidget(labelText: "${LocaleKeys.approvalNo.tr(context: context)} ${insuranceApprovalResponseModel.approvalNo}"), - AppCustomChipWidget(labelText: "${LocaleKeys.unusedCount.tr(context: context)} ${insuranceApprovalResponseModel.unUsedCount}"), + AppCustomChipWidget(labelText: "${LocaleKeys.approvalNo.tr(context: context)} ${insuranceApprovalResponseModel.approvalNo}", isEnglishOnly: true), + AppCustomChipWidget(labelText: "${LocaleKeys.unusedCount.tr(context: context)} ${insuranceApprovalResponseModel.unUsedCount}", isEnglishOnly: true), AppCustomChipWidget(labelText: "${LocaleKeys.companyName.tr(context: context)} ${insuranceApprovalResponseModel.companyName}"), AppCustomChipWidget( - labelText: - "${LocaleKeys.receiptOn.tr(context: context)} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceApprovalResponseModel.receiptOn), false)}"), + richText: Row( + mainAxisSize: MainAxisSize.min, + children: [ + "${LocaleKeys.receiptOn.tr(context: context)} ".toText10(), + Directionality( + textDirection: ui.TextDirection.ltr, + child: DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceApprovalResponseModel.receiptOn), false).toText10(isEnglishOnly: true)), + ], + ), + isEnglishOnly: true, + ), + AppCustomChipWidget( - labelText: - "${LocaleKeys.expiryOn.tr(context: context)} ${DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceApprovalResponseModel.expiryDate), false)}"), + richText: Row( + mainAxisSize: MainAxisSize.min, + children: [ + "${LocaleKeys.expiryOn.tr(context: context)} ".toText10(), + Directionality( + textDirection: ui.TextDirection.ltr, + child: DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceApprovalResponseModel.expiryDate), false).toText10(isEnglishOnly: true)), + ], + ), + isEnglishOnly: true, + ), + ], ), ], @@ -115,7 +138,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { decoration: RoundedRectangleBorder().toSmoothCornerDecoration( color: AppColors.whiteColor, borderRadius: 24.h, - hasShadow: true, + hasShadow: false, ), child: Padding( padding: EdgeInsets.all(16.h), @@ -138,7 +161,6 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { child: AnimatedContainer( duration: Duration(milliseconds: 300), curve: Curves.easeInOut, - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/presentation/insurance/widgets/insurance_approval_card.dart b/lib/presentation/insurance/widgets/insurance_approval_card.dart index 8f5f7cfb..faedb58d 100644 --- a/lib/presentation/insurance/widgets/insurance_approval_card.dart +++ b/lib/presentation/insurance/widgets/insurance_approval_card.dart @@ -15,6 +15,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; +import 'dart:ui' as ui; + class InsuranceApprovalCard extends StatelessWidget { InsuranceApprovalCard({super.key, required this.insuranceApprovalResponseModel, required this.isLoading, required this.appState}); @@ -88,6 +90,7 @@ class InsuranceApprovalCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ (isLoading ? "John Smith" : insuranceApprovalResponseModel.doctorName!).toText16(isBold: true).toShimmer2(isShow: isLoading), + SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, spacing: 3.h, @@ -98,14 +101,17 @@ class InsuranceApprovalCard extends StatelessWidget { // textColor: insuranceApprovalResponseModel.status == 9 ? AppColors.successColor : AppColors.primaryRedColor, // ).toShimmer2(isShow: isLoading), AppCustomChipWidget(labelText: isLoading ? "Cardiology" : insuranceApprovalResponseModel.clinicName!).toShimmer2(isShow: isLoading), - AppCustomChipWidget( - icon: AppAssets.doctor_calendar_icon, - labelText: isLoading ? "Cardiology" : DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceApprovalResponseModel.submitOn), false)) - .toShimmer2(isShow: isLoading), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + icon: AppAssets.doctor_calendar_icon, + labelText: isLoading ? "Cardiology" : DateUtil.formatDateToDate(DateUtil.convertStringToDate(insuranceApprovalResponseModel.submitOn), false), isEnglishOnly: true,) + .toShimmer2(isShow: isLoading), + ), isLoading ? SizedBox.shrink() : AppCustomChipWidget( - labelText: isLoading ? LocaleKeys.approvalNo.tr(context: context) : "${LocaleKeys.approvalNo.tr(context: context)} ${insuranceApprovalResponseModel.approvalNo}") + labelText: isLoading ? LocaleKeys.approvalNo.tr(context: context) : "${LocaleKeys.approvalNo.tr(context: context)} ${insuranceApprovalResponseModel.approvalNo}", isEnglishOnly: true,) .toShimmer2(isShow: isLoading), ], ), diff --git a/lib/presentation/insurance/widgets/insurance_update_details_card.dart b/lib/presentation/insurance/widgets/insurance_update_details_card.dart index ae1eaf51..51b9e05d 100644 --- a/lib/presentation/insurance/widgets/insurance_update_details_card.dart +++ b/lib/presentation/insurance/widgets/insurance_update_details_card.dart @@ -59,7 +59,7 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ insuranceViewModel.patientInsuranceUpdateResponseModel!.memberName!.toText16(weight: FontWeight.w600), - "Policy: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.policyNumber}".toText12(isBold: true, color: AppColors.lightGrayColor), + LocaleKeys.policyNumberInsurancePage.tr(namedArgs: {'number': insuranceViewModel.patientInsuranceUpdateResponseModel!.policyNumber.toString()}).toText12(isBold: true, color: AppColors.lightGrayColor, isEnglishOnly: true), SizedBox(height: 8.h), Row( children: [ @@ -87,9 +87,10 @@ class PatientInsuranceCardUpdateCard extends StatelessWidget { icon: AppAssets.doctor_calendar_icon, labelText: "${LocaleKeys.expiryOn.tr(context: context)} ${DateUtil.formatDateToDate(DateTime.parse(insuranceViewModel.patientInsuranceUpdateResponseModel!.effectiveTo!), false)}", + isEnglishOnly: true, ), AppCustomChipWidget( - labelText: "Member ID: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.memberID!}", + labelText: "Member ID: ${insuranceViewModel.patientInsuranceUpdateResponseModel!.memberID!}", isEnglishOnly: true, ), ], ), diff --git a/lib/presentation/insurance/widgets/patient_insurance_card.dart b/lib/presentation/insurance/widgets/patient_insurance_card.dart index d0f1b4db..16cbac20 100644 --- a/lib/presentation/insurance/widgets/patient_insurance_card.dart +++ b/lib/presentation/insurance/widgets/patient_insurance_card.dart @@ -54,11 +54,12 @@ class PatientInsuranceCard extends StatelessWidget { SizedBox( width: MediaQuery.of(context).size.width * 0.4, child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true, textOverflow: TextOverflow.clip, isEnglishOnly: true)), - Row( - children: [ - "${LocaleKeys.policyNumber.tr(context: context)}${insuranceCardDetailsModel.insurancePolicyNo}".toText12(isBold: true, color: AppColors.lightGrayColor), - ], - ), + LocaleKeys.policyNumberInsurancePage.tr(namedArgs: {'number': insuranceCardDetailsModel.insurancePolicyNo.toString()}).toText12(isBold: true, color: AppColors.lightGrayColor, isEnglishOnly: true), + // Row( + // children: [ + // "${LocaleKeys.policyNumber.tr(context: context)}${insuranceCardDetailsModel.insurancePolicyNo}".toText12(isBold: true, color: AppColors.lightGrayColor), + // ], + // ), ], ), isShowButtons ? AppCustomChipWidget( diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 25603bdc..a5a42e3b 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -199,11 +199,12 @@ class _MedicalFilePageState extends State { ], ), SizedBox(width: 4.h), - Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, height: 22.h, width: 22.w) + Transform.flip(flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.arrowRight, height: 22.h, width: 22.w)) ], ).onPress(() { Navigator.of(context).push( CustomPageRoute( + direction: AxisDirection.down, page: FamilyMedicalScreen(), ), ); diff --git a/lib/presentation/my_invoices/my_invoices_details_page.dart b/lib/presentation/my_invoices/my_invoices_details_page.dart index 4e7f0d48..a605160d 100644 --- a/lib/presentation/my_invoices/my_invoices_details_page.dart +++ b/lib/presentation/my_invoices/my_invoices_details_page.dart @@ -20,6 +20,8 @@ import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; + class MyInvoicesDetailsPage extends StatefulWidget { GetInvoiceDetailsResponseModel getInvoiceDetailsResponseModel; GetInvoicesListResponseModel getInvoicesListResponseModel; @@ -147,7 +149,7 @@ class _MyInvoicesDetailsPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - (getIt().isArabic() ? widget.getInvoiceDetailsResponseModel.doctorNameN! : widget.getInvoiceDetailsResponseModel.doctorName!).toText16(isBold: true), + (getIt().isArabic() ? widget.getInvoiceDetailsResponseModel.doctorNameN ?? LocaleKeys.doctor.tr(context: context) : widget.getInvoiceDetailsResponseModel.doctorName!).toText16(isBold: true), SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, @@ -155,23 +157,28 @@ class _MyInvoicesDetailsPageState extends State { runSpacing: 6.h, children: [ AppCustomChipWidget( - labelText: "${LocaleKeys.invoiceNo}: ${widget.getInvoiceDetailsResponseModel.invoiceNo!}", + labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${widget.getInvoiceDetailsResponseModel.invoiceNo!}", labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), + isEnglishOnly: true, ), AppCustomChipWidget( - labelText: (widget.getInvoiceDetailsResponseModel.clinicDescription!.length > 15 + labelText: ((getIt().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? "")!.length > 15 ? '${widget.getInvoiceDetailsResponseModel.clinicDescription!.substring(0, 12)}...' - : widget.getInvoiceDetailsResponseModel.clinicDescription!), + : getIt().isArabic() ? widget.getInvoiceDetailsResponseModel.clinicDescriptionN : widget.getInvoiceDetailsResponseModel.clinicDescription ?? ""), labelPadding: EdgeInsetsDirectional.only(start: 4.w, end: 4.w), ), AppCustomChipWidget( labelText: widget.getInvoiceDetailsResponseModel.projectName!, labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), ), - AppCustomChipWidget( - labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), - icon: AppAssets.doctor_calendar_icon, - labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.getInvoiceDetailsResponseModel.appointmentDate), false), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), + icon: AppAssets.doctor_calendar_icon, + labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.getInvoiceDetailsResponseModel.appointmentDate), false), + isEnglishOnly: true, + ), ), ], ), @@ -196,12 +203,12 @@ class _MyInvoicesDetailsPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Insurance Details".toText16(isBold: true), + LocaleKeys.insurance.tr(context: context).toText16(isBold: true), SizedBox(height: 16.h), - widget.getInvoiceDetailsResponseModel.groupName!.toText14(isBold: true), + (getIt().isArabic() ? widget.getInvoiceDetailsResponseModel.groupNameN : widget.getInvoiceDetailsResponseModel.groupName)!.toText14(isBold: true), Row( children: [ - Expanded(child: widget.getInvoiceDetailsResponseModel.companyName!.toText14(isBold: true)), + Expanded(child: (widget.getInvoiceDetailsResponseModel.companyName ?? "").toText14(isBold: true)), ], ), SizedBox(height: 12.h), @@ -210,6 +217,7 @@ class _MyInvoicesDetailsPageState extends State { AppCustomChipWidget( labelText: "Insurance ID: ${widget.getInvoiceDetailsResponseModel.insuranceID ?? "-"}", labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), + isEnglishOnly: true, ), ], ), @@ -254,9 +262,9 @@ class _MyInvoicesDetailsPageState extends State { child: Row( children: [ Expanded(flex: 3, child: (consultation.procedureName ?? '-').toText12(fontWeight: FontWeight.w500)), - Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), - Expanded(flex: 2, child: '${NumberFormat.decimalPattern().format(consultation.price) ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), - Expanded(flex: 2, child: '${NumberFormat.decimalPattern().format(consultation.total) ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true)), + Expanded(flex: 1, child: '${consultation.quantity ?? '-'}'.toText12(fontWeight: FontWeight.w500, isCenter: true, isEnglishOnly: true)), + Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.price) ?? '-').toText12(fontWeight: FontWeight.w500, isCenter: true, isEnglishOnly: true)), + Expanded(flex: 2, child: (NumberFormat.decimalPattern().format(consultation.total) ?? '-').toText12(fontWeight: FontWeight.w500, isCenter: true, isEnglishOnly: true)), ], ), ), @@ -291,7 +299,7 @@ class _MyInvoicesDetailsPageState extends State { children: [ LocaleKeys.amountBeforeTax.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol( - NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare).toString().toText16(isBold: true), AppColors.blackColor, 13, + NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalShare).toString().toText16(isBold: true, isEnglishOnly: true), AppColors.blackColor, 13, isSaudiCurrency: true), ], ).paddingSymmetrical(24.h, 0.h), @@ -303,7 +311,7 @@ class _MyInvoicesDetailsPageState extends State { NumberFormat.decimalPattern() .format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.totalVATAmount!) .toString() - .toText14(isBold: true, color: AppColors.greyTextColor), + .toText14(isBold: true, color: AppColors.greyTextColor, isEnglishOnly: true), AppColors.greyTextColor, 13, isSaudiCurrency: true), @@ -318,7 +326,7 @@ class _MyInvoicesDetailsPageState extends State { NumberFormat.decimalPattern() .format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.discountAmount!) .toString() - .toText14(isBold: true, color: AppColors.primaryRedColor), + .toText14(isBold: true, color: AppColors.primaryRedColor, isEnglishOnly: true), AppColors.primaryRedColor, 13, isSaudiCurrency: true), ], @@ -328,7 +336,7 @@ class _MyInvoicesDetailsPageState extends State { children: [ LocaleKeys.paid.tr(context: context).toText14(isBold: true), Utils.getPaymentAmountWithSymbol( - NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!).toString().toText14(isBold: true, color: AppColors.textColor), + NumberFormat.decimalPattern().format(widget.getInvoiceDetailsResponseModel.listConsultation!.first.grandTotal!).toString().toText14(isBold: true, color: AppColors.textColor, isEnglishOnly: true), AppColors.textColor, 13, isSaudiCurrency: true), diff --git a/lib/presentation/my_invoices/widgets/invoice_list_card.dart b/lib/presentation/my_invoices/widgets/invoice_list_card.dart index a45dfdd8..f2a1c6df 100644 --- a/lib/presentation/my_invoices/widgets/invoice_list_card.dart +++ b/lib/presentation/my_invoices/widgets/invoice_list_card.dart @@ -14,6 +14,8 @@ import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; +import 'dart:ui' as ui; + class InvoiceListCard extends StatelessWidget { final GetInvoicesListResponseModel getInvoicesListResponseModel; Function? onTap; @@ -102,8 +104,9 @@ class InvoiceListCard extends StatelessWidget { runSpacing: 6.h, children: [ AppCustomChipWidget( - labelText: "${LocaleKeys.invoiceNo}: ${getInvoicesListResponseModel.invoiceNo!}", + labelText: "${LocaleKeys.invoiceNo.tr(context: context)}: ${getInvoicesListResponseModel.invoiceNo!}", labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), + isEnglishOnly: true, ), AppCustomChipWidget( labelText: @@ -114,10 +117,14 @@ class InvoiceListCard extends StatelessWidget { labelText: getInvoicesListResponseModel.projectName!, labelPadding: EdgeInsetsDirectional.only(start: 6.w, end: 6.w), ), - AppCustomChipWidget( - labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), - icon: AppAssets.doctor_calendar_icon, - labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(getInvoicesListResponseModel.appointmentDate), false), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w), + icon: AppAssets.doctor_calendar_icon, + labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(getInvoicesListResponseModel.appointmentDate), false), + isEnglishOnly: true, + ), ), ], ), diff --git a/lib/presentation/prescriptions/prescription_detail_page.dart b/lib/presentation/prescriptions/prescription_detail_page.dart index 0ac9ce40..0d7d373a 100644 --- a/lib/presentation/prescriptions/prescription_detail_page.dart +++ b/lib/presentation/prescriptions/prescription_detail_page.dart @@ -154,6 +154,7 @@ class _PrescriptionDetailPageState extends State { icon: AppAssets.rating_icon, iconColor: AppColors.ratingColorYellow, labelText: LocaleKeys.ratingValue.tr(namedArgs: {'rating': widget.prescriptionsResponseModel.decimalDoctorRate.toString()}, context: context), + isEnglishOnly: true, ), AppCustomChipWidget( labelText: widget.prescriptionsResponseModel.name ?? "", diff --git a/lib/presentation/prescriptions/prescription_item_view.dart b/lib/presentation/prescriptions/prescription_item_view.dart index 13ddebf1..5b52b99b 100644 --- a/lib/presentation/prescriptions/prescription_item_view.dart +++ b/lib/presentation/prescriptions/prescription_item_view.dart @@ -68,7 +68,7 @@ class PrescriptionItemView extends StatelessWidget { labelText: "${LocaleKeys.dailyDoses.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].doseDailyQuantity}", ).toShimmer2(isShow: isLoading), AppCustomChipWidget( - labelText: "${LocaleKeys.days.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].days}", + labelText: "${LocaleKeys.days.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].days}", isEnglishOnly: true, ).toShimmer2(isShow: isLoading), ], ).paddingSymmetrical(16.h, 0.h), diff --git a/lib/presentation/rate_appointment/widget/doctor_row.dart b/lib/presentation/rate_appointment/widget/doctor_row.dart index d85518f0..2a139d05 100644 --- a/lib/presentation/rate_appointment/widget/doctor_row.dart +++ b/lib/presentation/rate_appointment/widget/doctor_row.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart'; @@ -8,6 +7,8 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/appointment_details_resp_model.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; +import 'dart:ui' as ui; + class BuildDoctorRow extends StatelessWidget { bool isForClinic = false; AppointmentDetails? appointmentDetails; @@ -49,6 +50,7 @@ class BuildDoctorRow extends StatelessWidget { icon: AppAssets.ic_date_filter, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(appointmentDetails!.appointmentDate), false), + isEnglishOnly: true, ), AppCustomChipWidget( @@ -70,10 +72,14 @@ class BuildDoctorRow extends StatelessWidget { labelText: appointmentDetails!.clinicName.toString(), ), - AppCustomChipWidget( - labelPadding: EdgeInsetsDirectional.only(start: -8.w, end: 6.w), - icon: AppAssets.ic_date_filter, - labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(appointmentDetails!.appointmentDate), false), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelPadding: EdgeInsetsDirectional.only(start: -8.w, end: 6.w), + icon: AppAssets.ic_date_filter, + labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(appointmentDetails!.appointmentDate), false), + isEnglishOnly: true, + ), ), ], ), diff --git a/lib/presentation/todo_section/ancillary_order_payment_page.dart b/lib/presentation/todo_section/ancillary_order_payment_page.dart index 75c76dc8..a8de2708 100644 --- a/lib/presentation/todo_section/ancillary_order_payment_page.dart +++ b/lib/presentation/todo_section/ancillary_order_payment_page.dart @@ -35,7 +35,7 @@ class AncillaryOrderPaymentPage extends StatefulWidget { final int orderNo; final int projectID; final List selectedProcedures; - final double totalAmount; + final num totalAmount; const AncillaryOrderPaymentPage({ super.key, diff --git a/lib/presentation/todo_section/ancillary_procedures_details_page.dart b/lib/presentation/todo_section/ancillary_procedures_details_page.dart index ef1aba72..b65d26df 100644 --- a/lib/presentation/todo_section/ancillary_procedures_details_page.dart +++ b/lib/presentation/todo_section/ancillary_procedures_details_page.dart @@ -24,6 +24,8 @@ import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; + class AncillaryOrderDetailsList extends StatefulWidget { final int appointmentNoVida; final int orderNo; @@ -114,12 +116,13 @@ class _AncillaryOrderDetailsListState extends State { } } - double _getTotalAmount() { - double total = 0.0; + num _getTotalAmount() { + num total = 0.0; for (var proc in selectedProcedures) { total += (proc.patientShareWithTax ?? 0); } return total; + // return 1234.50; } @override @@ -253,8 +256,9 @@ class _AncillaryOrderDetailsListState extends State { children: [ AppCustomChipWidget( // icon: AppAssets.file_icon, - labelText: "MRN: ${patientMRN ?? 'N/A'}", + labelText: "${LocaleKeys.fileno.tr(context: context)}: ${patientMRN ?? 'N/A'}", iconSize: 12.w, + isEnglishOnly: true, ), // National ID @@ -263,20 +267,23 @@ class _AncillaryOrderDetailsListState extends State { // icon: AppAssets.card_user, labelText: "ID: $nationalID", iconSize: 12.w, + isEnglishOnly: true, ), // Appointment Number if (orderData.appointmentNo != null) AppCustomChipWidget( // icon: AppAssets.calendar, - labelText: "Appt #: ${orderData.appointmentNo}", + labelText: "${LocaleKeys.appointment.tr(context: context)}: ${orderData.appointmentNo}", iconSize: 12.w, + isEnglishOnly: true, ), // Order Number if (orderData.ancillaryOrderProcDetailsList?.firstOrNull?.orderNo != null) AppCustomChipWidget( labelText: "Order #: ${orderData.ancillaryOrderProcDetailsList!.first.orderNo}", + isEnglishOnly: true, ), // Blood Group @@ -297,12 +304,14 @@ class _AncillaryOrderDetailsListState extends State { backgroundColor: AppColors.successColor.withValues(alpha: 0.15), iconSize: 12.w, labelPadding: EdgeInsetsDirectional.only(start: -6.w, end: 8.w), + isEnglishOnly: true, ), // Policy Number if (orderData.insurancePolicyNo != null && orderData.insurancePolicyNo!.isNotEmpty) AppCustomChipWidget( - labelText: "Policy: ${orderData.insurancePolicyNo}", + labelText: "${LocaleKeys.policyNumber.tr(context: context)}: ${orderData.insurancePolicyNo}", + isEnglishOnly: true, ), AppCustomChipWidget( @@ -317,8 +326,12 @@ class _AncillaryOrderDetailsListState extends State { labelText: "Clinic: ${orderData.clinicName!}", ), if (orderData.clinicName != null && orderData.clinicName!.isNotEmpty) - AppCustomChipWidget( - labelText: "Date: ${DateFormat('MMM dd, yyyy').format(orderData.appointmentDate!)}", + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + labelText: "${LocaleKeys.date.tr(context: context)}: ${DateFormat('MMM dd yyyy').format(orderData.appointmentDate!)}", + isEnglishOnly: true, + ), ), ], ), @@ -557,7 +570,7 @@ class _AncillaryOrderDetailsListState extends State { Row( children: [ Utils.getPaymentAmountWithSymbol( - (procedure.patientShare ?? 0).toStringAsFixed(2).toText13(weight: FontWeight.w600), + (procedure.patientShare ?? 0).toStringAsFixed(2).toText14(weight: FontWeight.w600, isEnglishOnly: true), AppColors.textColorLight, 13, isSaudiCurrency: true, @@ -576,7 +589,7 @@ class _AncillaryOrderDetailsListState extends State { Row( children: [ Utils.getPaymentAmountWithSymbol( - (procedure.patientTaxAmount ?? 0).toStringAsFixed(2).toText13(weight: FontWeight.w600), + (procedure.patientTaxAmount ?? 0).toStringAsFixed(2).toText12(fontWeight: FontWeight.w600, isEnglishOnly: true), AppColors.textColorLight, 13, isSaudiCurrency: true, @@ -595,7 +608,7 @@ class _AncillaryOrderDetailsListState extends State { Row( children: [ Utils.getPaymentAmountWithSymbol( - (procedure.patientShareWithTax ?? 0).toStringAsFixed(2).toText13(weight: FontWeight.w600), + (procedure.patientShareWithTax ?? 0).toStringAsFixed(2).toText12(fontWeight: FontWeight.w600, isEnglishOnly: true), AppColors.textColorLight, 13, isSaudiCurrency: true, @@ -646,7 +659,7 @@ class _AncillaryOrderDetailsListState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Utils.getPaymentAmountWithSymbol(_getTotalAmount().toStringAsFixed(2).toText24(isBold: true), AppColors.blackColor, 17, isSaudiCurrency: true), + Utils.getPaymentAmountWithSymbol(NumberFormat.decimalPattern().format(_getTotalAmount()).toText24(isBold: true, isEnglishOnly: true), AppColors.blackColor, 17, isSaudiCurrency: true), ], ), ], diff --git a/lib/presentation/todo_section/widgets/ancillary_orders_list.dart b/lib/presentation/todo_section/widgets/ancillary_orders_list.dart index 6a41252e..c05d7fc9 100644 --- a/lib/presentation/todo_section/widgets/ancillary_orders_list.dart +++ b/lib/presentation/todo_section/widgets/ancillary_orders_list.dart @@ -15,6 +15,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; +import 'dart:ui' as ui; + class AncillaryOrdersList extends StatelessWidget { final List orders; final Function(AncillaryOrderItem order)? onCheckIn; @@ -173,20 +175,26 @@ class AncillaryOrderCard extends StatelessWidget { if (order.orderNo != null || isLoading) AppCustomChipWidget( // icon: AppAssets.calendar, - labelText: "${LocaleKeys.orderNumber.tr(context: context)}${order.orderNo ?? '-'}", - ).toShimmer2(isShow: isLoading), + labelText: "${LocaleKeys.orderNumber.tr(context: context)}${order.orderNo ?? '-'}", + isEnglishOnly: true) + .toShimmer2(isShow: isLoading), // Appointment Date if (order.appointmentDate != null || isLoading) - AppCustomChipWidget( - icon: AppAssets.appointment_calendar_icon, - labelText: isLoading ? "Date: Jan 20, 2024" : DateFormat('MMM dd, yyyy').format(order.appointmentDate!), - ).toShimmer2(isShow: isLoading), + Directionality( + textDirection: ui.TextDirection.ltr, + child: AppCustomChipWidget( + icon: AppAssets.appointment_calendar_icon, + labelText: isLoading ? "Date: Jan 20, 2024" : DateFormat('MMM dd, yyyy').format(order.appointmentDate!), + isEnglishOnly: true, + ).toShimmer2(isShow: isLoading), + ), // Appointment Number if (order.appointmentNo != null || isLoading) AppCustomChipWidget( - labelText: isLoading ? "Appt# : 98765" : "Appt #: ${order.appointmentNo}", + labelText: isLoading ? "Appt# : 98765" : "${LocaleKeys.appointment.tr(context: context)}: ${order.appointmentNo}", + isEnglishOnly: true, ).toShimmer2(isShow: isLoading), // Invoice Number diff --git a/lib/presentation/vital_sign/vital_sign_details_page.dart b/lib/presentation/vital_sign/vital_sign_details_page.dart index 587a910f..3d6f97be 100644 --- a/lib/presentation/vital_sign/vital_sign_details_page.dart +++ b/lib/presentation/vital_sign/vital_sign_details_page.dart @@ -16,6 +16,8 @@ import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/graph/custom_graph.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; + /// Which vital sign is being shown in the details screen. enum VitalSignMetric { bmi, @@ -139,15 +141,13 @@ class _VitalSignDetailsPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ title.toText28(isBold: true, color: AppColors.textColor, letterSpacing: -1), - - ], ), SizedBox(height: 8.h), (latestDate != null ? LocaleKeys.resultOf.tr(namedArgs: {'date': latestDate.toString().split(' ').first}) : LocaleKeys.resultOfNoDate.tr(context: context)) - .toText11(weight: FontWeight.w500, color: AppColors.greyTextColor), + .toText11(weight: FontWeight.w500, color: AppColors.greyTextColor, isEnglishOnly: true), ], ), Row( @@ -430,10 +430,14 @@ class _VitalSignDetailsPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - dp.displayTime.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), - valueText.toText12( - color: AppColors.textColor, - fontWeight: FontWeight.w600, + dp.displayTime.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500, isEnglishOnly: true), + Directionality( + textDirection: ui.TextDirection.ltr, + child: valueText.toText12( + color: AppColors.textColor, + fontWeight: FontWeight.w600, + isEnglishOnly: true + ), ), ], ), @@ -756,7 +760,7 @@ class _VitalSignDetailsPageState extends State { top: 8.0, right: isLast ? 16.h : 0, ), - child: label.toText8(fontWeight: FontWeight.w500), + child: label.toText10(weight: FontWeight.w500, isEnglishOnly: true), ); } diff --git a/lib/widgets/graph/custom_graph.dart b/lib/widgets/graph/custom_graph.dart index c655ec0d..898dc5ea 100644 --- a/lib/widgets/graph/custom_graph.dart +++ b/lib/widgets/graph/custom_graph.dart @@ -192,7 +192,7 @@ class CustomGraph extends StatelessWidget { return LineTooltipItem( '${dataPoint.actualValue} ${dataPoint.unitOfMeasurement ?? ""} - ${dataPoint.displayTime}', - TextStyle(color: Colors.black, fontSize: 12.f, fontWeight: FontWeight.w500), + TextStyle(color: Colors.black, fontSize: 12.f, fontWeight: FontWeight.w500, fontFamily: "Poppins"), ); }).toList(); }, diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index e162c5ea..a64775aa 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -159,8 +159,8 @@ class TextInputWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ _buildLabelText(labelColor).paddingOnly( - right: (appState.getLanguageCode() == "ar" ? 10 : 0), - left: (appState.getLanguageCode() == "en" ? 10 : 0), + right: (appState.isArabic() ? 10 : 10), + left: (!appState.isArabic() ? 10 : 10), ), Row( children: [ @@ -230,7 +230,8 @@ class TextInputWidget extends StatelessWidget { language: appState.getLanguageCode()!, initialDate: DateTime.now(), showCalendarToggle: isHideSwitcher == true ? false : true, - fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins", + // fontFamily: appState.getLanguageCode() == "ar" ? "GESSTwo" : "Poppins", + fontFamily: "Poppins", okWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.confirm, width: 24.h, height: 24.h)), cancelWidget: Padding(padding: EdgeInsets.only(right: 8.h), child: Utils.buildSvgWithAssets(icon: AppAssets.cancel, iconColor: Colors.white, width: 24.h, height: 24.h)), onCalendarTypeChanged: (bool value) {