From 01c21377aabda83e2a09d6927d4bfc023f2ca1d2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 9 Feb 2026 15:58:10 +0300 Subject: [PATCH] Updates & fixes --- assets/langs/ar-SA.json | 12 +-- assets/langs/en-US.json | 13 ++-- lib/core/api/api_client.dart | 14 +++- lib/core/api_consts.dart | 3 +- lib/core/utils/loading_utils.dart | 2 +- lib/extensions/string_extensions.dart | 3 +- lib/features/lab/lab_view_model.dart | 13 +++- .../prescriptions/prescriptions_repo.dart | 4 +- .../prescriptions_view_model.dart | 10 +-- lib/generated/locale_keys.g.dart | 5 +- .../appointment_payment_page.dart | 2 + .../widgets/appointment_card.dart | 2 +- .../LabResultByClinic.dart | 2 +- .../ai_analysis_widget.dart | 1 + .../lab_order_result_item.dart | 78 ++++++++++--------- .../lab/lab_results/lab_result_details.dart | 2 +- .../lab_ai_analysis_detailed_page.dart | 6 +- .../prescriptions/prescription_item_view.dart | 40 +++++----- lib/widgets/app_language_change.dart | 28 +++++++ lib/widgets/appbar/collapsing_list_view.dart | 4 +- lib/widgets/language_switcher.dart | 5 +- lib/widgets/loader/bottomsheet_loader.dart | 4 +- 22 files changed, 153 insertions(+), 100 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 50b0c0c..11ab941 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1528,7 +1528,7 @@ "prediction": "تنبؤ", "prevention": "وقاية", "disclaimer": "تنصل", - "thisAboveInfo": "المعلومات المذكورة أعلاه تم إنشاؤها بواسطة AI", + "thisAboveInfo": "المعلومات المذكورة أعلاه مُولّدة بواسطة AI بناءً على نتائج تحاليلك المخبرية، وهي لأغراض إعلامية فقط. لا ينبغي اعتبارها تشخيصًا طبيًا أو خطة علاجية. استشر طبيبك دائمًا للحصول على نصيحة طبية مُخصصة قبل اتخاذ أي قرارات تتعلق بصحتك.", "aiDisclaimer": "سيتم مشاركة بيانات نتائج تحاليلك المخبرية بشكل آمن مع خدمة الذكاء الاصطناعي لدينا لتحليلها. يساعد هذا في تقديم رؤى صحية مُخصصة. هل ترغب في المتابعة؟", "consent": "موافقة", "bmiNormalDescription": "مؤشر كتلة جسمك ضمن المعدل الصحي. استمر في اتباع نظام غذائي متوازن، وممارسة النشاط البدني بانتظام، وإجراء الفحوصات الدورية للحفاظ على صحة جيدة. راقب أي تغييرات ملحوظة مع مرور الوقت.", @@ -1559,10 +1559,7 @@ "dietZoneDietDescription": "Zone Diet (~40% carbs / 30% protein / 30% fat): emphasizes hormonal balance and portion control. May improve body composition and energy for some, but requires planning; personalize with a nutrition professional.", "contextDependent": "يعتمد السياق", "calculatedValue": "القيمة المحسوبة", - "calculationFormula": "صيغة الحساب" - - - + "calculationFormula": "صيغة الحساب", "confirmYourLocation": "قم بتأكيد موقعك", "confirmYourLocationDesc": "يرجى تأكيد موقعك الحالي لعرض الاتجاهات المناسبة.", "insideHospital": "أنا داخل المستشفى", @@ -1571,5 +1568,8 @@ "servicePriceListDesc": "توضح قائمة أسعار الخدمات أدناه رسوم الخدمات الصحية المقدمة للمرضى بنظام الدفع النقدي. أما فيما يتعلق بالخدمات المشمولة بالتأمين، فسيتم تطبيق التغطية التأمينية والتحقق من الأهلية واحتساب نسب التحمل وفقًا لشروط وثيقة التأمين وجدول المنافع المعتمد لكل شركة تأمين.", "servicePriceListRights": "يحق للمريض الحصول على متابعة مجانية في غضون 14 يومًا من الزيارة الأولى", "serviceName": "اسم الخدمة", - "noFreeSlot": "لا توجد مواعيد متاحة في التاريخ المحدد. يرجى اختيار تاريخ آخر أو إعادة المحاولة لاحقاً." + "noFreeSlot": "لا توجد مواعيد متاحة في التاريخ المحدد. يرجى اختيار تاريخ آخر أو إعادة المحاولة لاحقاً.", + "noThanksIKnowTheClinic": "لا، شكراً. أنا أعرف العيادة.", + "unableToSendOTP": "تعذر إرسال رمز التحقق لمرة واحدة", + "loadingAIAnalysis": "جارٍ تحميل بياناتك وتحليلها، يُرجى التحلي بالصبر ودع الذكاء الاصطناعي يقوم بالمهمة. يُرجى التحلي بالصبر، فقد يستغرق هذا بعض الوقت." } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 65b08f2..3f1bc78 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1439,7 +1439,6 @@ "healthy": "Healthy", "warning": "Warning", "vitalSignDetails": "Vital Sign Details", - "resultOf": "Result of {date}", "resultOfNoDate": "Result of --", "referenceRangeBetween": "Reference range: {low} – {high} {unit}", "referenceRangeMin": "Reference range: ≥ {low} {unit}", @@ -1522,7 +1521,7 @@ "servicePriceListDesc": "Below is the services price list outline the healthcare services fees for cash payments, where the insurance coverage, eligibility, and co-payment deductions will be processed in accordance with the insurance policy terms and the table of benefits of each insurance providers:", "servicePriceListRights": "The patient has the right to a free follow-up within 14 days of initial visit", "serviceName": "Service Name", - "noFreeSlot": "No free slot available for the selected date. Please select another date or check back later." + "noFreeSlot": "No free slot available for the selected date. Please select another date or check back later.", "noThanksIKnowTheClinic": "No, Thanks. I Know the clinic", "unableToSendOTP": "Unable to send Verification OTP", "aiOverView": "AI Overview", @@ -1531,8 +1530,8 @@ "prediction": "Prediction", "prevention": "Prevention", "disclaimer": "Disclaimer", - "thisAboveInfo": "The above information is generated by", - "aiDisclaimer": "Your lab result data will be securely shared with our AI service for analysis. This helps provide personalized health insights. Do you want to proceed?", + "thisAboveInfo": "The above information is generated by AI based on your lab results and is intended for informational purposes only. It should not be considered a medical diagnosis or treatment plan. Always consult with your healthcare provider for personalized medical advice and before making any health-related decisions.", + "aiDisclaimer": "Your lab result data will be securely shared with our AI Analyzer for analysis. This helps provide personalized health insights. Do you want to proceed?", "consent": "Consent", "bmiNormalDescription": "Your BMI is within the healthy range. Continue a balanced diet, regular physical activity, and routine checkups to maintain good health. Monitor any significant changes over time.", "bmiUnderweightDescription": "BMI suggests you are underweight. Consider increasing calorie intake with nutrient-dense foods, include resistance training to build muscle, and consult a healthcare professional to check for underlying causes.", @@ -1562,8 +1561,6 @@ "dietZoneDietDescription": "Zone Diet (~40% carbs / 30% protein / 30% fat): emphasizes hormonal balance and portion control. May improve body composition and energy for some, but requires planning; personalize with a nutrition professional.", "contextDependent": "Context Dependent", "calculatedValue": "Calculated Value", - "calculationFormula": "Calculation Formula" - - - + "calculationFormula": "Calculation Formula", + "loadingAIAnalysis": "Loading and analysing your data, Please be patient and let the AI do the magic. Please be patient, This might take some time." } diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index ea8062d..f74ff4d 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -181,8 +181,18 @@ class ApiClientImp implements ApiClient { body[_appState.isAuthenticated ? 'TokenID' : 'LogInTokenID'] = _appState.appAuthToken; } - // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 4768663; + if (url.contains("HMGAI_Lab_Analyze_Orders_API")) { + url = "https://uat.hmgwebservices.com/Services/Patients.svc/REST/HMGAI_Lab_Analyze_Orders_API"; + body['TokenID'] = "@dm!n"; + } + + if (url.contains("HMGAI_Lab_Analyzer_API")) { + url = "https://uat.hmgwebservices.com/Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; + body['TokenID'] = "@dm!n"; + } + + body['TokenID'] = "@dm!n"; + body['PatientID'] = 4773882; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index c08cdda..f78c020 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -908,7 +908,8 @@ class ApiConsts { static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; // ************ static values for Api **************** - static final double appVersionID = 19.7; + // static final double appVersionID = 19.7; + static final double appVersionID = 50.7; static final int appChannelId = 3; static final String appIpAddress = "10.20.10.20"; static final String appGeneralId = "Cs2020@2016\$2958"; diff --git a/lib/core/utils/loading_utils.dart b/lib/core/utils/loading_utils.dart index 1a99278..bd24d30 100644 --- a/lib/core/utils/loading_utils.dart +++ b/lib/core/utils/loading_utils.dart @@ -38,7 +38,7 @@ class LoadingUtils { child: Material( child: Center( child: isSuccessDialog ? Utils.getSuccessWidget(loadingText: loadingText) : Utils.getLoadingWidget(loadingText: loadingText), - ), + ).paddingSymmetrical(24.w, 0), ), ); }).then((value) { diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 6a00942..f087f74 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -423,11 +423,12 @@ extension DynamicTextStyleExtension on BuildContext { Locale? locale, TextBaseline? textBaseline, FontStyle? fontStyle, + String? fontFamily, bool isLanguageSwitcher = false}) { AppState appState = getIt.get(); final family = appState.getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'; return TextStyle( - fontFamily: family, + fontFamily: fontFamily ?? family, fontSize: fontSize, fontWeight: fontWeight, color: color, diff --git a/lib/features/lab/lab_view_model.dart b/lib/features/lab/lab_view_model.dart index 04c945d..22e4859 100644 --- a/lib/features/lab/lab_view_model.dart +++ b/lib/features/lab/lab_view_model.dart @@ -400,6 +400,10 @@ class LabViewModel extends ChangeNotifier { lowRefenceValue = minY; } + if (minY > lowRefenceValue) { + minY = lowRefenceValue - 25; + } + this.flagForHighReferenceRange = flagForHighReferenceRange; this.flagForLowReferenceRange = flagForLowReferenceRange; highTransformedReferenceValue = double.parse(transformValueInRange(highRefrenceValue, flagForHighReferenceRange ?? "").toStringAsFixed(1)); @@ -728,8 +732,9 @@ class LabViewModel extends ChangeNotifier { notifyListeners(); } - Future getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder}) async { - LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic"); + Future getAiOverviewLabOrders({required PatientLabOrdersResponseModel labOrder, required String loadingText}) async { + // LoadingUtils.showFullScreenLoader(loadingText: "Loading and analysing your data,\nPlease be patient and let the AI do the magic. \nPlease be patient, This might take some time."); + LoadingUtils.showFullScreenLoader(loadingText: loadingText); List> results = []; Map orderData = {"order_date": labOrder.orderDate ?? "", "clinic": labOrder.clinicDescription ?? "", "doctor": labOrder.doctorName ?? "", "results": []}; List> testResults = []; @@ -769,8 +774,8 @@ class LabViewModel extends ChangeNotifier { LoadingUtils.hideFullScreenLoader(); } - Future getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult}) async { - LoaderBottomSheet.showLoader(); + Future getAiOverviewSingleLabResult({required String langId, required LabResult recentLabResult, required String loadingText}) async { + LoaderBottomSheet.showLoader(loadingText: loadingText); List> results = []; results.add({ "Description": recentLabResult.description ?? '', diff --git a/lib/features/prescriptions/prescriptions_repo.dart b/lib/features/prescriptions/prescriptions_repo.dart index 2eb5d43..dcc9de9 100644 --- a/lib/features/prescriptions/prescriptions_repo.dart +++ b/lib/features/prescriptions/prescriptions_repo.dart @@ -193,8 +193,8 @@ class PrescriptionsRepoImp implements PrescriptionsRepo { "ProjectID": prescriptionsResponseModel.projectID, "DischargeNo": prescriptionsResponseModel.dischargeNo, "IsDownload": true, - // "To": Utils.appState.getAuthenticatedUser()!.emailAddress, - "To": "amjad.haroon@cloudsolutions.com.sa", + "To": Utils.appState.getAuthenticatedUser()!.emailAddress, + // "To": "amjad.haroon@cloudsolutions.com.sa", "ClinicName": prescriptionsResponseModel.clinicDescription, "DoctorName": prescriptionsResponseModel.doctorName, }; diff --git a/lib/features/prescriptions/prescriptions_view_model.dart b/lib/features/prescriptions/prescriptions_view_model.dart index a7cd42f..319e5fc 100644 --- a/lib/features/prescriptions/prescriptions_view_model.dart +++ b/lib/features/prescriptions/prescriptions_view_model.dart @@ -54,7 +54,7 @@ class PrescriptionsViewModel extends ChangeNotifier { PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices}); initPrescriptionsViewModel() { - if (isPrescriptionsDataNeedsReloading) { + // if (isPrescriptionsDataNeedsReloading) { patientPrescriptionOrders.clear(); patientPrescriptionOrdersByClinic.clear(); patientPrescriptionOrdersByHospital.clear(); @@ -62,7 +62,7 @@ class PrescriptionsViewModel extends ChangeNotifier { prescriptionsOrderList.clear(); isPrescriptionsOrdersLoading = true; getPatientPrescriptionOrders(); - } + // } isSortByClinic = true; isPrescriptionsDeliveryOrdersLoading = true; notifyListeners(); @@ -102,9 +102,9 @@ class PrescriptionsViewModel extends ChangeNotifier { } Future getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { - if (!isPrescriptionsDataNeedsReloading) { - return; - } + // if (!isPrescriptionsDataNeedsReloading) { + // return; + // } final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755"); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 7229726..7bafadf 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1513,8 +1513,6 @@ abstract class LocaleKeys { static const trackerAndOthers = 'trackerAndOthers'; static const bmi = 'bmi'; static const yesPleaseINeedHelp = 'yesPleaseINeedHelp'; - static const noThanksIKnowTheClinic = 'noThanksIKnowTheClinic'; - static const unableToSendOTP = 'unableToSendOTP'; static const aiOverView = 'aiOverView'; static const generateAiAnalysis = 'generateAiAnalysis'; static const aiAnalysis = 'aiAnalysis'; @@ -1562,5 +1560,8 @@ abstract class LocaleKeys { static const servicePriceListRights = 'servicePriceListRights'; static const serviceName = 'serviceName'; static const noFreeSlot = 'noFreeSlot'; + static const noThanksIKnowTheClinic = 'noThanksIKnowTheClinic'; + static const unableToSendOTP = 'unableToSendOTP'; + static const loadingAIAnalysis = 'loadingAIAnalysis'; } diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index 097efaf..e70ddf4 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -491,6 +491,7 @@ class _AppointmentPaymentPageState extends State { patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, onSuccess: (apiResponse) { Future.delayed(Duration(milliseconds: 500), () { + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.getPatientAppointments(true, false); LoaderBottomSheet.hideLoader(); @@ -511,6 +512,7 @@ class _AppointmentPaymentPageState extends State { isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!, onSuccess: (apiResponse) { Future.delayed(Duration(milliseconds: 500), () { + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.getPatientAppointments(true, false); LoaderBottomSheet.hideLoader(); diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 49aad51..971e9ca 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -193,7 +193,7 @@ class AppointmentCard extends StatelessWidget { ? 'Cardiology'.toText10().toShimmer2(isShow: isLoading) : "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)} ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate), false)}" .toText10(isEnglishOnly: true), - ), + ).toShimmer2(isShow: isLoading), ), // AppCustomChipWidget( diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart index 954c09b..8fb3090 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart @@ -50,7 +50,7 @@ class LabResultByClinic extends StatelessWidget { cancelLabel: LocaleKeys.rejectView.tr(), onOkPressed: () { context.pop(); - labViewModel.getAiOverviewLabOrders(labOrder: labOrder); + labViewModel.getAiOverviewLabOrders(labOrder: labOrder, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); }, onCancelPressed: () { context.pop(); diff --git a/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart b/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart index a2d0ff6..f0c9b26 100644 --- a/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart +++ b/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart @@ -62,6 +62,7 @@ class AiAnalysisWidget extends StatelessWidget { SizedBox(height: 20.h), ], Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Icon(Icons.info_outline, color: AppColors.greyTextColor, size: 20.r), SizedBox(width: 8.w), diff --git a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart index e332066..ba97731 100644 --- a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart +++ b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart @@ -11,6 +11,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:provider/provider.dart'; +import 'dart:ui' as ui; class LabOrderResultItem extends StatelessWidget { final VoidCallback onTap; @@ -43,49 +44,52 @@ class LabOrderResultItem extends StatelessWidget { ), (tests!.packageShortDescription ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight), SizedBox(height: 12.h), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Flexible( - child: Text( - "${tests?.resultValue} ${tests?.uOM}", - style: TextStyle( - fontSize: 24.f, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins', - color: tests!.checkIfGraphShouldBeDisplayed() - ? context.read().getColor( - tests?.calculatedResultFlag ?? "", - ) - : Colors.grey.shade700, - letterSpacing: -2, - ), - ), - ), - SizedBox(width: 4.h,), - Visibility( - // visible: tests?.checkIfGraphShouldBeDisplayed() == true, - visible: true, - child: Expanded( - flex: 2, - child: Visibility( - visible: tests?.referanceRange != null, + Directionality( + textDirection: ui.TextDirection.ltr, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Flexible( child: Text( - "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", + "${tests?.resultValue} ${tests?.uOM}", style: TextStyle( - fontSize: 12.f, - fontWeight: FontWeight.w500, + fontSize: 24.f, + fontWeight: FontWeight.w600, fontFamily: 'Poppins', - color: AppColors.greyTextColor, + color: tests!.checkIfGraphShouldBeDisplayed() + ? context.read().getColor( + tests?.calculatedResultFlag ?? "", + ) + : Colors.grey.shade700, + letterSpacing: -2, ), - // overflow: TextOverflow.ellipsis, - // maxLines: 2, - softWrap: true, ), ), - ), - ) - ], + SizedBox(width: 4.h,), + Visibility( + // visible: tests?.checkIfGraphShouldBeDisplayed() == true, + visible: true, + child: Expanded( + flex: 2, + child: Visibility( + visible: tests?.referanceRange != null, + child: Text( + "(${LocaleKeys.referenceRange.tr(context: context)}: ${tests?.referanceRange})", + style: TextStyle( + fontSize: 12.f, + fontWeight: FontWeight.w500, + fontFamily: 'Poppins', + color: AppColors.greyTextColor, + ), + // overflow: TextOverflow.ellipsis, + // maxLines: 2, + softWrap: true, + ), + ), + ), + ) + ], + ), ), SizedBox(height: 12.h), diff --git a/lib/presentation/lab/lab_results/lab_result_details.dart b/lib/presentation/lab/lab_results/lab_result_details.dart index c67c39d..cab20ae 100644 --- a/lib/presentation/lab/lab_results/lab_result_details.dart +++ b/lib/presentation/lab/lab_results/lab_result_details.dart @@ -45,7 +45,7 @@ class LabResultDetails extends StatelessWidget { cancelLabel: LocaleKeys.rejectView.tr(), onOkPressed: () { context.pop(); - labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult); + labViewModel.getAiOverviewSingleLabResult(langId: appState.getLanguageID().toString(), recentLabResult: recentLabResult, loadingText: LocaleKeys.loadingAIAnalysis.tr(context: context)); }, onCancelPressed: () { context.pop(); diff --git a/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart b/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart index 5a5aed7..5d4fe4b 100644 --- a/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart +++ b/lib/presentation/labAiAnalysis/lab_ai_analysis_detailed_page.dart @@ -341,7 +341,7 @@ class _LabAiAnalysisDetailedPageState extends State { case 'high': return AppColors.primaryRedColor; case 'medium' || 'moderate': - return AppColors.lightGreenColor; + return AppColors.textGreenColor; case 'low': return AppColors.alertColor; default: @@ -361,7 +361,7 @@ class _LabAiAnalysisDetailedPageState extends State { case 'L': // Low case 'LL': // Very Low case 'CRITICAL LOW': - return AppColors.chipColorSeekMedicalAdvice; + return AppColors.chipColorSeekMedicalAdvice.withAlpha(75); case 'N': // Normal return AppColors.lightGreenButtonColor; case 'A': // Abnormal @@ -379,7 +379,7 @@ class _LabAiAnalysisDetailedPageState extends State { case 'CRITICAL HIGH': return AppColors.primaryRedColor; case 'N': - return AppColors.lightGreenColor; + return AppColors.textGreenColor; case 'L': // Low case 'LL': // Very Low case 'CRITICAL LOW': diff --git a/lib/presentation/prescriptions/prescription_item_view.dart b/lib/presentation/prescriptions/prescription_item_view.dart index a41b53f..03a343f 100644 --- a/lib/presentation/prescriptions/prescription_item_view.dart +++ b/lib/presentation/prescriptions/prescription_item_view.dart @@ -155,26 +155,26 @@ class PrescriptionItemView extends StatelessWidget { ], ).paddingSymmetrical(16.h, 0.h), SizedBox(height: 14.h), - Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), - Row( - children: [ - Expanded( - child: CustomButton( - text: LocaleKeys.checkAvailability.tr(context: context), - onPressed: () {}, - backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), - borderColor: AppColors.primaryRedColor.withOpacity(0.0), - textColor: AppColors.primaryRedColor, - fontSize: 14.f, - fontWeight: FontWeight.w500, - borderRadius: 12.r, - padding: EdgeInsets.fromLTRB(10, 0, 10, 0), - height: 40.h, - ).toShimmer2(isShow: isLoading), - ), - // SizedBox(width: 16.h), - ], - ).paddingSymmetrical(16.h, 16.h), + // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h), + // Row( + // children: [ + // Expanded( + // child: CustomButton( + // text: LocaleKeys.checkAvailability.tr(context: context), + // onPressed: () {}, + // backgroundColor: AppColors.primaryRedColor.withOpacity(0.1), + // borderColor: AppColors.primaryRedColor.withOpacity(0.0), + // textColor: AppColors.primaryRedColor, + // fontSize: 14.f, + // fontWeight: FontWeight.w500, + // borderRadius: 12.r, + // padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + // height: 40.h, + // ).toShimmer2(isShow: isLoading), + // ), + // // SizedBox(width: 16.h), + // ], + // ).paddingSymmetrical(16.h, 16.h), ], ), ); diff --git a/lib/widgets/app_language_change.dart b/lib/widgets/app_language_change.dart index c94195a..e75ff6f 100644 --- a/lib/widgets/app_language_change.dart +++ b/lib/widgets/app_language_change.dart @@ -4,9 +4,14 @@ import 'package:hmg_patient_app_new/core/utils/size_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/emergency_services/emergency_services_view_model.dart'; +import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart'; +import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; +import 'package:hmg_patient_app_new/features/todo_section/todo_section_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; +import 'package:provider/provider.dart'; class AppLanguageChange extends StatefulWidget { AppLanguageChange({Key? key}) : super(key: key); @@ -20,6 +25,11 @@ class AppLanguageChange extends StatefulWidget { class _AppLanguageChangeState extends State { String? selectedValue; + late MyAppointmentsViewModel myAppointmentsViewModel; + late ImmediateLiveCareViewModel immediateLiveCareViewModel; + late EmergencyServicesViewModel emergencyServicesViewModel; + late TodoSectionViewModel todoSectionViewModel; + @override void initState() { super.initState(); @@ -33,6 +43,12 @@ class _AppLanguageChangeState extends State { @override Widget build(BuildContext context) { selectedValue ??= context.locale.languageCode; + + myAppointmentsViewModel = Provider.of(context, listen: false); + immediateLiveCareViewModel = Provider.of(context, listen: false); + emergencyServicesViewModel = Provider.of(context, listen: false); + todoSectionViewModel = Provider.of(context, listen: false); + return Column( spacing: 24.h, children: [ @@ -51,6 +67,18 @@ class _AppLanguageChangeState extends State { text: LocaleKeys.save.tr(context: context), onPressed: () { context.setLocale(selectedValue == 'en' ? Locale('en', 'US') : Locale('ar', 'SA')).then((val) { + //Reload My Appointments Data + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); + myAppointmentsViewModel.initAppointmentsViewModel(); + myAppointmentsViewModel.getPatientAppointments(true, false); + + //Reload Immediate LiveCare Data + immediateLiveCareViewModel.initImmediateLiveCare(); + immediateLiveCareViewModel.getPatientLiveCareHistory(); + + //Reload Emergency Services Data + emergencyServicesViewModel.checkPatientERAdvanceBalance(); + Navigator.pop(context); }); }), diff --git a/lib/widgets/appbar/collapsing_list_view.dart b/lib/widgets/appbar/collapsing_list_view.dart index aaaaa51..2522196 100644 --- a/lib/widgets/appbar/collapsing_list_view.dart +++ b/lib/widgets/appbar/collapsing_list_view.dart @@ -310,7 +310,7 @@ class _ScrollAnimatedTitleState extends State { child: Container( height: 40.h, padding: EdgeInsets.all(8.w), - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.transparent, borderRadius: 10.r, side: BorderSide(width: 1, color: AppColors.borderGrayColor)), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 8.r, side: BorderSide(width: 1, color: AppColors.borderGrayColor)), child: ShaderMask( blendMode: BlendMode.srcIn, shaderCallback: (bounds) => AppColors.aiLinearGradient.createShader(bounds), @@ -326,7 +326,7 @@ class _ScrollAnimatedTitleState extends State { style: context.dynamicTextStyle( color: AppColors.primaryRedColor, letterSpacing: -0.4, - fontSize: (12 - (2 * (1 - t))).f, + fontSize: (14 - (2 * (1 - t))).f, fontWeight: FontWeight.lerp( FontWeight.w400, FontWeight.w500, diff --git a/lib/widgets/language_switcher.dart b/lib/widgets/language_switcher.dart index 91e45b2..033eaaf 100644 --- a/lib/widgets/language_switcher.dart +++ b/lib/widgets/language_switcher.dart @@ -59,14 +59,15 @@ class _LanguageSelectorState extends State { Utils.buildSvgWithAssets(icon: AppAssets.language), SizedBox(width: 6.h), Text( - currentLangData['name']?.toUpperCase() ?? 'EN', + // currentLangData['name']?.toUpperCase() ?? 'EN', + widget.currentLanguage == 'ar' ? "ENGLISH" : "العربية", style: context.dynamicTextStyle( fontWeight: FontWeight.w500, fontSize: 14.f, color: AppColors.primaryRedColor, letterSpacing: 0.1, isLanguageSwitcher: true, - ), + fontFamily: widget.currentLanguage == 'ar' ? "Poppins" : "GESSTwo"), ), ], ), diff --git a/lib/widgets/loader/bottomsheet_loader.dart b/lib/widgets/loader/bottomsheet_loader.dart index 813ad5b..71b8341 100644 --- a/lib/widgets/loader/bottomsheet_loader.dart +++ b/lib/widgets/loader/bottomsheet_loader.dart @@ -3,7 +3,9 @@ import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/enums.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/widget_extensions.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; class LoaderBottomSheet { @@ -31,7 +33,7 @@ class LoaderBottomSheet { ), child: Center( child: Utils.getLoadingWidget(loadingText: loadingText), - ), + ).paddingSymmetrical(24.w, 0), ); }, ).whenComplete(() {