From 89a1da4407cc9449b17358281b10d61d84a910e2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 7 Apr 2026 17:50:36 +0300 Subject: [PATCH] Updates --- assets/langs/ar-SA.json | 8 +++++++- assets/langs/en-US.json | 8 +++++++- lib/core/utils/utils.dart | 4 ++-- .../resp_models/doctors_list_response_model.dart | 2 +- .../models/ui_models/vital_sign_ui_model.dart | 12 +++++++----- .../symptoms_checker/symptoms_checker_repo.dart | 4 +++- .../symptoms_checker_view_model.dart | 1 + lib/generated/locale_keys.g.dart | 6 ++++++ .../appointments/appointment_details_page.dart | 8 ++++---- .../appointments/appointment_payment_page.dart | 6 +++--- .../book_appointment/review_appointment_page.dart | 10 +++++----- .../emergency_services/emergency_services_page.dart | 2 +- .../insurance/insurance_approval_details_page.dart | 2 +- lib/presentation/lab/search_lab_report.dart | 2 +- .../eye_measurements_appointments_page.dart | 2 +- lib/presentation/my_family/widget/family_cards.dart | 4 ++-- .../profile_settings/widgets/family_card_widget.dart | 2 +- lib/widgets/appbar/collapsing_list_view.dart | 4 ++-- 18 files changed, 55 insertions(+), 32 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 65ff39cf..a522d37f 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1673,5 +1673,11 @@ "doctorRatingAppointment": "طبيب\nتصنيف", "ratingSubmitted": "تم إرسال التقييم", "rateTheDoctor": "يرجى تقييم الطبيب", - "downloadInvoice": "تحميل الفاتورة" + "downloadInvoice": "تحميل الفاتورة", + "approvalDetails": "تفاصيل الموافقة", + "obese": "سمين", + "overWeight": "وزن زائد", + "underWeight": "وزن ناقص", + "nearestGate": "أقرب بوابة", + "RRTDDetails": "فريق الاستجابة السريعة يقوم بتقديم رعاية صحية متكاملة لجميع الحالات الطارئة و المستقرة، الخدمة تشمل جميع الأعمار بما في ذلك حالات الأطفال." } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 9ecf7f6a..fb88ec02 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1665,5 +1665,11 @@ "doctorRatingAppointment": "Doctor\nRating", "ratingSubmitted": "Rating Submitted", "rateTheDoctor": "Please rate the doctor", - "downloadInvoice": "Download Invoice" + "downloadInvoice": "Download Invoice", + "approvalDetails": "Approval Details", + "obese": "Obese", + "overWeight": "OverWeight", + "underWeight": "UnderWeight", + "nearestGate": "Nearest Gate", + "RRTDDetails": "The Rapid response team provides a comprehensive medical service for all sorts of urgent and stable cases of all ages, including adult and paediatric patients." } diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 89cc4996..feca055a 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -371,7 +371,7 @@ class Utils { Lottie.asset(AppAnimations.loadingAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 80.h, height: 80.h, fit: BoxFit.fill), SizedBox(height: 8.h), - (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, isCenter: true), + (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, isCenter: true, isBold: true), SizedBox(height: 8.h), ], ).center; @@ -384,7 +384,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).paddingSymmetrical(24.h, 0.h), + (loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor, isBold: true).paddingSymmetrical(24.h, 0.h), SizedBox(height: 8.h), ], ).center; diff --git a/lib/features/book_appointments/models/resp_models/doctors_list_response_model.dart b/lib/features/book_appointments/models/resp_models/doctors_list_response_model.dart index 75ed1229..a9aa273e 100644 --- a/lib/features/book_appointments/models/resp_models/doctors_list_response_model.dart +++ b/lib/features/book_appointments/models/resp_models/doctors_list_response_model.dart @@ -193,7 +193,7 @@ class DoctorsListResponseModel { serviceID = json['ServiceID']; setupID = json['SetupID']; speciality = json['Speciality'] != null ? json['Speciality'].cast() : []; - // specialityN = json['SpecialityN'].cast(); + specialityN = json['SpecialityN'] != null ? json['SpecialityN'].cast() : []; transactionType = json['TransactionType']; virtualEmploymentType = json['VirtualEmploymentType']; workingHours = json['WorkingHours']; diff --git a/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart b/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart index 66f5d77b..7746d29b 100644 --- a/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart +++ b/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart @@ -1,4 +1,6 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; /// UI-only helper model for Vital Sign cards. @@ -49,7 +51,7 @@ class VitalSignUiModel { } // Warning for both low and overweight/underweight BMI, since they can indicate potential health issues. - if (s.contains('low') || s.contains('underweight') || s.contains('overweight')) { + if (s.contains('low') || s.contains(LocaleKeys.underWeight.tr()) || s.contains(LocaleKeys.overWeight.tr())) { final Color yellowBg = AppColors.highAndLow.withValues(alpha: 0.12); return VitalSignUiModel( iconBg: yellowBg, @@ -96,13 +98,13 @@ class VitalSignUiModel { final double bmiResult = double.tryParse(bmi.toString()) ?? 0; if (bmiResult >= 30) { - bmiStatus = "High"; + bmiStatus = LocaleKeys.obese.tr(); } else if (bmiResult < 30 && bmiResult >= 25) { - bmiStatus = "Overweight"; + bmiStatus = LocaleKeys.overWeight.tr(); } else if (bmiResult < 25 && bmiResult >= 18.5) { - bmiStatus = "Normal"; + bmiStatus = LocaleKeys.normal.tr(); } else if (bmiResult < 18.5) { - bmiStatus = "Underweight"; + bmiStatus = LocaleKeys.underWeight.tr(); } // if (bmi == null) return 'N/A'; diff --git a/lib/features/symptoms_checker/symptoms_checker_repo.dart b/lib/features/symptoms_checker/symptoms_checker_repo.dart index 33bcbd8f..7fee030b 100644 --- a/lib/features/symptoms_checker/symptoms_checker_repo.dart +++ b/lib/features/symptoms_checker/symptoms_checker_repo.dart @@ -54,6 +54,7 @@ abstract class SymptomsCheckerRepo { Future>>> getClinicDetails({ required String categoryName, + required String language, required String userSessionToken, }); } @@ -400,6 +401,7 @@ class SymptomsCheckerRepoImp implements SymptomsCheckerRepo { @override Future>>> getClinicDetails({ required String categoryName, + required String language, required String userSessionToken, }) async { Map headers = { @@ -413,7 +415,7 @@ class SymptomsCheckerRepoImp implements SymptomsCheckerRepo { Failure? failure; await apiClient.get( - "${ApiConsts.getClinicFromCondition}$categoryName", + "${ApiConsts.getClinicFromCondition}$categoryName&language=$language", apiHeaders: headers, isExternal: true, isAllowAny: true, diff --git a/lib/features/symptoms_checker/symptoms_checker_view_model.dart b/lib/features/symptoms_checker/symptoms_checker_view_model.dart index 215b6921..d06b2538 100644 --- a/lib/features/symptoms_checker/symptoms_checker_view_model.dart +++ b/lib/features/symptoms_checker/symptoms_checker_view_model.dart @@ -1079,6 +1079,7 @@ class SymptomsCheckerViewModel extends ChangeNotifier { final result = await symptomsCheckerRepo.getClinicDetails( categoryName: categoryName, + language: appState.isArabic() ? 'ar' : 'en', userSessionToken: currentSessionAuthToken, ); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 7bc82108..6d0ef0be 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1666,5 +1666,11 @@ abstract class LocaleKeys { static const ratingSubmitted = 'ratingSubmitted'; static const rateTheDoctor = 'rateTheDoctor'; static const downloadInvoice = 'downloadInvoice'; + static const approvalDetails = 'approvalDetails'; + static const obese = 'obese'; + static const overWeight = 'overWeight'; + static const underWeight = 'underWeight'; + static const nearestGate = 'nearestGate'; + static const RRTDDetails = 'RRTDDetails'; } diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 9048d924..fc5d766a 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -359,12 +359,12 @@ class _AppointmentDetailsPageState extends State { AppCustomChipWidget( labelText: bookAppointmentsVM.isAppointmentNearestGateLoading ? "Floor: Ground Floor" - : "Floor: ${getIt.get().isArabic() ? bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocationN : bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocation}", - ).toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), + : "${LocaleKeys.floor.tr(context: context)}: ${getIt.get().isArabic() ? bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocationN : bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocation}", + ).toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), AppCustomChipWidget( labelText: - "Nearest Gate: ${getIt.get().isArabic() ? bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumberN : bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumber}") - .toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), + "${LocaleKeys.nearestGate.tr(context: context)}: ${getIt.get().isArabic() ? bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumberN : bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumber}") + .toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), ], ) : SizedBox.shrink(), ], diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index 11f651ff..54d7991a 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -111,7 +111,7 @@ class _AppointmentPaymentPageState extends State { Image.asset(AppAssets.mada, width: 72.h, height: 25.h) .toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), SizedBox(height: 16.h), - "Mada".toText16(isBold: true).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), + LocaleKeys.mada.tr(context: context).toText16(isBold: true).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), ], ), SizedBox(width: 8.h), @@ -153,7 +153,7 @@ class _AppointmentPaymentPageState extends State { ], ).toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), SizedBox(height: 16.h), - "Visa or Mastercard" + LocaleKeys.visaOrMastercard.tr(context: context) .toText16(isBold: true) .toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), ], @@ -193,7 +193,7 @@ class _AppointmentPaymentPageState extends State { Image.asset(AppAssets.tamaraEng, width: 72.h, height: 25.h) .toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), SizedBox(height: 16.h), - "Tamara" + LocaleKeys.tamara.tr(context: context) .toText16(isBold: true) .toShimmer2(isShow: myAppointmentsVM.isAppointmentPatientShareLoading), ], diff --git a/lib/presentation/book_appointment/review_appointment_page.dart b/lib/presentation/book_appointment/review_appointment_page.dart index 1f4b7c5d..a3138dff 100644 --- a/lib/presentation/book_appointment/review_appointment_page.dart +++ b/lib/presentation/book_appointment/review_appointment_page.dart @@ -161,7 +161,7 @@ class _ReviewAppointmentPageState extends State { spacing: 4.h, runSpacing: 4.h, children: [ - AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} Years Old"), + AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} ${LocaleKeys.yearsOld.tr(context: context)}"), AppCustomChipWidget(labelText: "${LocaleKeys.gender.tr(context: context)}: ${appState.getAuthenticatedUser()?.gender == 1 ? LocaleKeys.malE.tr(context: context) : LocaleKeys.femaleGender.tr(context: context)}"), ], ), @@ -197,12 +197,12 @@ class _ReviewAppointmentPageState extends State { AppCustomChipWidget( labelText: bookAppointmentsVM.isAppointmentNearestGateLoading ? "Floor: Ground Floor" - : "Floor: ${getIt.get().isArabic() ? bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocationN : bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocation}", - ).toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), + : "${LocaleKeys.floor.tr(context: context)} ${getIt.get().isArabic() ? bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocationN : bookAppointmentsViewModel.appointmentNearestGateResponseModel!.clinicLocation}", + ).toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), AppCustomChipWidget( labelText: - "Nearest Gate: ${getIt.get().isArabic() ? bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumberN : bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumber}") - .toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), + "${LocaleKeys.nearestGate.tr(context: context)} ${getIt.get().isArabic() ? bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumberN : bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumber}") + .toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading), ], ) : SizedBox.shrink(), diff --git a/lib/presentation/emergency_services/emergency_services_page.dart b/lib/presentation/emergency_services/emergency_services_page.dart index ef0fa2d5..3d5470a8 100644 --- a/lib/presentation/emergency_services/emergency_services_page.dart +++ b/lib/presentation/emergency_services/emergency_services_page.dart @@ -220,7 +220,7 @@ class _EmergencyServicesPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.rapidResponseTeam.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), - "Comprehensive medical service for all sorts of urgent and stable cases".toText12(color: AppColors.greyTextColor, isBold: true), + LocaleKeys.RRTDDetails.tr(context: context).toText12(color: AppColors.greyTextColor, isBold: true), ], ), ), diff --git a/lib/presentation/insurance/insurance_approval_details_page.dart b/lib/presentation/insurance/insurance_approval_details_page.dart index 7a26833d..6589bc4e 100644 --- a/lib/presentation/insurance/insurance_approval_details_page.dart +++ b/lib/presentation/insurance/insurance_approval_details_page.dart @@ -145,7 +145,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { child: insuranceApprovalResponseModel.apporvalDetails != null ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - "Approval Details".toText16(isBold: true), + LocaleKeys.approvalDetails.toText16(isBold: true), ListView.separated( padding: EdgeInsets.only(top: 16.h), shrinkWrap: true, diff --git a/lib/presentation/lab/search_lab_report.dart b/lib/presentation/lab/search_lab_report.dart index cd526c97..ac559f42 100644 --- a/lib/presentation/lab/search_lab_report.dart +++ b/lib/presentation/lab/search_lab_report.dart @@ -94,7 +94,7 @@ class _SearchLabResultsContentState extends State { ), SizedBox(height: ResponsiveExtension(20).h), if (filteredSuggestions.isNotEmpty) ...[ - "Suggestions".toText16(isBold: true, isEnglishOnly: true), + LocaleKeys.suggestions.tr(context: context).toText16(isBold: true, isEnglishOnly: true), ], ], ), diff --git a/lib/presentation/medical_file/eye_measurements_appointments_page.dart b/lib/presentation/medical_file/eye_measurements_appointments_page.dart index d8438ba4..df30a5a3 100644 --- a/lib/presentation/medical_file/eye_measurements_appointments_page.dart +++ b/lib/presentation/medical_file/eye_measurements_appointments_page.dart @@ -25,7 +25,7 @@ class EyeMeasurementsAppointmentsPage extends StatelessWidget { return Scaffold( backgroundColor: AppColors.bgScaffoldColor, body: CollapsingListView( - title: "Eye Measurements", + title: LocaleKeys.eyeMeasurements.tr(context: context), child: SingleChildScrollView( child: Consumer(builder: (context, myAppointmentsVM, child) { return Column( diff --git a/lib/presentation/my_family/widget/family_cards.dart b/lib/presentation/my_family/widget/family_cards.dart index 20ae15aa..ecc8cbbc 100644 --- a/lib/presentation/my_family/widget/family_cards.dart +++ b/lib/presentation/my_family/widget/family_cards.dart @@ -345,7 +345,7 @@ class _FamilyCardsState extends State { CustomChipWidget( chipType: ChipTypeEnum.alert, backgroundColor: AppColors.lightGrayBGColor, - chipText: "Relation: ${profile.relationship ?? " N/A"}", + chipText: "${LocaleKeys.relationship.tr(context: context)}: ${profile.relationship ?? " N/A"}", iconAsset: AppAssets.heart, isShowBorder: false, borderRadius: 8.h, @@ -355,7 +355,7 @@ class _FamilyCardsState extends State { ? CustomChipWidget( chipType: ChipTypeEnum.alert, backgroundColor: AppColors.lightGrayBGColor, - chipText: "Age: ${profile.age ?? "N/A"} Years", + chipText: "${LocaleKeys.age.tr(context: context)}: ${profile.age ?? "N/A"} ${LocaleKeys.years.tr(context: context)}", isShowBorder: false, borderRadius: 8.h, textColor: AppColors.textColor, diff --git a/lib/presentation/profile_settings/widgets/family_card_widget.dart b/lib/presentation/profile_settings/widgets/family_card_widget.dart index d6373bb5..ffa6644b 100644 --- a/lib/presentation/profile_settings/widgets/family_card_widget.dart +++ b/lib/presentation/profile_settings/widgets/family_card_widget.dart @@ -54,7 +54,7 @@ class FamilyCardWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - "${profile.patientName}".toText18(isBold: true, isBold: true, textOverflow: TextOverflow.ellipsis, maxlines: 1), + "${profile.patientName}".toText18(isBold: true, textOverflow: TextOverflow.ellipsis, maxlines: 1), AppCustomChipWidget( icon: AppAssets.file_icon, labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${profile.responseId}", diff --git a/lib/widgets/appbar/collapsing_list_view.dart b/lib/widgets/appbar/collapsing_list_view.dart index 3b7c64c6..d641cb77 100644 --- a/lib/widgets/appbar/collapsing_list_view.dart +++ b/lib/widgets/appbar/collapsing_list_view.dart @@ -388,8 +388,8 @@ class _ScrollAnimatedTitleState extends State { letterSpacing: -0.4, fontSize: (12 - (2 * (1 - t))).f, fontWeight: FontWeight.lerp( - FontWeight.w400, - FontWeight.w600, + FontWeight.w500, + FontWeight.w700, t, )!, ),