From deca29b42355e7856d0662ed17cafecccc97e5ce Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sat, 4 Apr 2026 07:02:25 +0300 Subject: [PATCH] updates & fixes --- assets/langs/ar-SA.json | 5 +- assets/langs/en-US.json | 5 +- .../hmg_services/hmg_services_repo.dart | 2 - .../my_appointments/my_appointments_repo.dart | 5 +- .../my_appointments_view_model.dart | 4 + lib/generated/locale_keys.g.dart | 1 + .../appointment_details_page.dart | 102 ++++++++++-------- .../appointments/my_appointments_page.dart | 2 +- .../widgets/appointment_card.dart | 2 +- .../book_appointment/doctor_profile_page.dart | 9 +- .../laser/laser_appointment.dart | 2 + .../laser/widgets/body_part_listing.dart | 31 +++--- .../review_appointment_page.dart | 2 +- .../book_appointment/select_doctor_page.dart | 4 +- lib/presentation/contact_us/contact_us.dart | 2 + .../contact_us/live_chat_page.dart | 4 +- lib/presentation/home/landing_page.dart | 2 + .../lab_result_via_clinic/LabResultList.dart | 2 +- .../medical_file/medical_file_page.dart | 9 +- .../rate_appointment_doctor.dart | 4 +- .../rate_appointment/widget/doctor_row.dart | 30 +++--- .../vital_sign/vital_sign_details_page.dart | 62 ++++++----- .../vital_sign/vital_sign_page.dart | 6 +- lib/widgets/common_bottom_sheet.dart | 18 ++++ 24 files changed, 192 insertions(+), 123 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 31dba2d9..28b7a873 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1640,9 +1640,10 @@ "homeHealthCareServiceDescription": "نقدم لكم رعاية صحية عالية الجودة تصلكم إلى عتبة منزلكم. ممرضات ذوات خبرة يقدمون رعاية حانية في راحة منزلكم.", "profileOnlyText": "الملف الشخصي", "information": "معلومة", - "noFavouriteDoctors": "ليس لديك أي أطباء مفضلين حتى الآن", + "noFavouriteDoctors": "ليس لديك أي قائمة مفضلة حتى الآن", "addDoctors": "إضافة الأطباء", "favouriteList": "قائمة المفضلة", - "later": "لاحقاً" + "later": "لاحقاً", + "cancelAppointmentConfirmMessage": "هل أنت متأكد من رغبتك في إلغاء هذا الموعد؟" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 64cb63a3..50e635ba 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1632,8 +1632,9 @@ "homeHealthCareServiceDescription": "We bring quality healthcare to your doorstep. Experienced nurses providing compassionate care in the comfort of your home.", "profileOnlyText": "Profile", "information": "Information", - "noFavouriteDoctors": "You don't have any favourite doctors yet", + "noFavouriteDoctors": "You don't have any favourite list yet", "addDoctors": "Add Doctors", "favouriteList": "Favourite List", - "later": "Later" + "later": "Later", + "cancelAppointmentConfirmMessage": "Are you sure you want to cancel this appointment?" } diff --git a/lib/features/hmg_services/hmg_services_repo.dart b/lib/features/hmg_services/hmg_services_repo.dart index 89285339..b70e024c 100644 --- a/lib/features/hmg_services/hmg_services_repo.dart +++ b/lib/features/hmg_services/hmg_services_repo.dart @@ -919,8 +919,6 @@ class HmgServicesRepoImp implements HmgServicesRepo { @override Future>>> getPatientVitalSign() async { Map requestBody = { - - }; try { diff --git a/lib/features/my_appointments/my_appointments_repo.dart b/lib/features/my_appointments/my_appointments_repo.dart index ccf76ce0..e29644cd 100644 --- a/lib/features/my_appointments/my_appointments_repo.dart +++ b/lib/features/my_appointments/my_appointments_repo.dart @@ -513,7 +513,10 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo { try { final list = response['PatientDoctorAppointmentResultList']; - final appointmentsList = list.map((item) => PatientAppointmentHistoryResponseModel.fromJson(item as Map)).toList().cast(); + List appointmentsList = + list.map((item) => PatientAppointmentHistoryResponseModel.fromJson(item as Map)).toList().cast(); + + appointmentsList.removeWhere((element) => element.isActiveDoctorProfile == false); apiResponse = GenericApiModel>( messageStatus: messageStatus, diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index aa56d440..a1c48867 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -94,6 +94,10 @@ class MyAppointmentsViewModel extends ChangeNotifier { selectedTabIndex = index; start = null; end = null; + // if (index == 0) { + // filteredAppointmentList.clear(); + // filteredAppointmentList.addAll(patientAppointmentsHistoryList); + // } notifyListeners(); } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 98265513..94d7a20f 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1636,5 +1636,6 @@ abstract class LocaleKeys { static const addDoctors = 'addDoctors'; static const favouriteList = 'favouriteList'; static const later = 'later'; + static const cancelAppointmentConfirmMessage = 'cancelAppointmentConfirmMessage'; } diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index f01c4a59..1930f5fe 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -37,6 +37,7 @@ import 'package:hmg_patient_app_new/presentation/ask_doctor/doctor_response_page import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart'; import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_detail_page.dart'; +import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -148,41 +149,55 @@ class _AppointmentDetailsPageState extends State { }); }, onCancelTap: () async { - LoaderBottomSheet.showLoader(loadingText: LocaleKeys.cancellingAppointmentPleaseWait.tr(context: context)); - await myAppointmentsViewModel.cancelAppointment( - patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, - onSuccess: (apiResponse) { - LoaderBottomSheet.hideLoader(); - myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); - myAppointmentsViewModel.getPatientAppointments(true, false); - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentCancelledSuccessfully.tr(context: context)), - callBackFunc: () { - Navigator.of(context).pop(); - }, - title: "", - isCloseButtonVisible: true, - isDismissible: false, - isFullScreen: false, - ); - }, - onError: (err) { - LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: err.toString()), - callBackFunc: () {}, - title: "", - isCloseButtonVisible: true, - isDismissible: false, - isFullScreen: false, - ); - }); - var isEventAddedOrRemoved = await CalenderUtilsNew.instance.checkAndRemove( id:"${widget.patientAppointmentHistoryResponseModel.appointmentNo}", ); - setState(() { - myAppointmentsViewModel.setAppointmentReminder(isEventAddedOrRemoved, widget.patientAppointmentHistoryResponseModel); - }); + showCommonBottomSheetWithoutHeight( + title: LocaleKeys.notice.tr(context: context), + context, + child: Utils.getWarningWidget( + loadingText: LocaleKeys.cancelAppointmentConfirmMessage.tr(context: context), + isShowActionButtons: true, + onCancelTap: () { + Navigator.of(context).pop(); + }, + onConfirmTap: () async { + Navigator.of(context).pop(); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.cancellingAppointmentPleaseWait.tr(context: context)); + await myAppointmentsViewModel.cancelAppointment( + patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel, + onSuccess: (apiResponse) async { + LoaderBottomSheet.hideLoader(); + myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); + myAppointmentsViewModel.getPatientAppointments(true, false); + showCommonBottomSheet( + context, + child: Utils.getSuccessWidget(loadingText: LocaleKeys.appointmentCancelledSuccessfully.tr(context: context)), + callBackFunc: (str) { + Navigator.of(context).pop(); + }, + title: "", + isCloseButtonVisible: false, + isDismissible: false, + isFullScreen: false, + isAutoDismiss: true, + height: ResponsiveExtension.screenHeight * 0.3, + ); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err.toString()), + callBackFunc: () {}, + title: "", isCloseButtonVisible: true, isDismissible: false, isFullScreen: false); + }); + }), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + // var isEventAddedOrRemoved = await CalenderUtilsNew.instance.checkAndRemove( id:"${widget.patientAppointmentHistoryResponseModel.appointmentNo}", ); + // setState(() { + // myAppointmentsViewModel.setAppointmentReminder(isEventAddedOrRemoved, widget.patientAppointmentHistoryResponseModel); + // }); }, onRescheduleTap: () async { openDoctorScheduleCalendar(); @@ -987,7 +1002,7 @@ class _AppointmentDetailsPageState extends State { doctorImageURL: widget.patientAppointmentHistoryResponseModel.doctorImageURL, doctorTitle: widget.patientAppointmentHistoryResponseModel.doctorTitle, name: widget.patientAppointmentHistoryResponseModel.doctorNameObj, - nationalityFlagURL: "https://hmgwebservices.com/Images/flag/SYR.png", + nationalityFlagURL: "", speciality: [], clinicName: widget.patientAppointmentHistoryResponseModel.clinicName, projectName: widget.patientAppointmentHistoryResponseModel.projectName, @@ -1036,17 +1051,18 @@ class _AppointmentDetailsPageState extends State { myAppointmentsViewModel.initAppointmentsViewModel(); myAppointmentsViewModel.getPatientAppointments(true, false); Navigator.of(context).pop(); - }, - title: "", - height: ResponsiveExtension.screenHeight * 0.3, - isCloseButtonVisible: true, - isDismissible: false, - isFullScreen: false, + }, title: "", height: ResponsiveExtension.screenHeight * 0.3, isAutoDismiss: true, isCloseButtonVisible: true, isDismissible: false, isFullScreen: false, isSuccessDialog: true); }); // LoaderBottomSheet.hideLoader(); case 15: - break; + getIt.get().showCommonBottomSheetWithoutH( + message: LocaleKeys.upcomingPaymentPending.tr(context: context), + label: LocaleKeys.notice.tr(), + onOkPressed: () {}, + okLabel: "confirm", + cancelLabel: LocaleKeys.confirm.tr(context: context), + ); case 20: myAppointmentsViewModel.setIsPatientAppointmentShareLoading(true); Navigator.of(context).push( diff --git a/lib/presentation/appointments/my_appointments_page.dart b/lib/presentation/appointments/my_appointments_page.dart index c9e70487..9b309d49 100644 --- a/lib/presentation/appointments/my_appointments_page.dart +++ b/lib/presentation/appointments/my_appointments_page.dart @@ -144,7 +144,7 @@ class _MyAppointmentsPageState extends State { ? myAppointmentsVM.patientAppointmentsViewList.length : 1, itemBuilder: (context, index) { - final isExpanded = expandedIndex == index; + final isExpanded = myAppointmentsVM.selectedTabIndex == 1 ? true : expandedIndex == index; return myAppointmentsVM.isMyAppointmentsLoading ? Container( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 35846549..c120a323 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -456,7 +456,7 @@ class AppointmentCard extends StatelessWidget { doctorImageURL: patientAppointmentHistoryResponseModel.doctorImageURL, doctorTitle: patientAppointmentHistoryResponseModel.doctorTitle, name: patientAppointmentHistoryResponseModel.doctorNameObj, - nationalityFlagURL: 'https://hmgwebservices.com/Images/flag/SYR.png', + nationalityFlagURL: '', speciality: [], clinicName: patientAppointmentHistoryResponseModel.clinicName, projectName: patientAppointmentHistoryResponseModel.projectName, diff --git a/lib/presentation/book_appointment/doctor_profile_page.dart b/lib/presentation/book_appointment/doctor_profile_page.dart index 095133de..f9761c3a 100644 --- a/lib/presentation/book_appointment/doctor_profile_page.dart +++ b/lib/presentation/book_appointment/doctor_profile_page.dart @@ -180,7 +180,7 @@ class DoctorProfilePage extends StatelessWidget { SizedBox(height: 16.h), LocaleKeys.information.tr(context: context).toText14(weight: FontWeight.w600, color: AppColors.textColor), SizedBox(height: 6.h), - bookAppointmentsViewModel.doctorsProfileResponseModel.doctorProfileInfo!.toText12(fontWeight: FontWeight.w600, color: AppColors.greyTextColor), + (bookAppointmentsViewModel.doctorsProfileResponseModel.doctorProfileInfo ?? "").trim().toText12(fontWeight: FontWeight.w600, color: AppColors.greyTextColor), SizedBox(height: 24.h), ], ).paddingSymmetrical(24.h, 0.h), @@ -199,7 +199,12 @@ class DoctorProfilePage extends StatelessWidget { bookAppointmentsViewModel.selectedDoctor.speciality = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty; bookAppointmentsViewModel.selectedDoctor.specialityN = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty; bookAppointmentsViewModel.selectedDoctor.name = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName; - bookAppointmentsViewModel.selectedDoctor.name = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName; + bookAppointmentsViewModel.selectedDoctor.doctorImageURL = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorImageURL; + bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL = bookAppointmentsViewModel.doctorsProfileResponseModel.nationalityFlagURL; + bookAppointmentsViewModel.selectedDoctor.clinicName = bookAppointmentsViewModel.doctorsProfileResponseModel.clinicDescription; + bookAppointmentsViewModel.selectedDoctor.projectName = bookAppointmentsViewModel.doctorsProfileResponseModel.projectName; + + LoaderBottomSheet.showLoader(); bookAppointmentsViewModel.isLiveCareSchedule ? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots( diff --git a/lib/presentation/book_appointment/laser/laser_appointment.dart b/lib/presentation/book_appointment/laser/laser_appointment.dart index c6bb1bd0..c8773933 100644 --- a/lib/presentation/book_appointment/laser/laser_appointment.dart +++ b/lib/presentation/book_appointment/laser/laser_appointment.dart @@ -93,6 +93,7 @@ class LaserAppointment extends StatelessWidget { viewmodel.getLaserClinic(); }, ), + SizedBox(height: 8.h), Selector( selector: (_, vm) => vm.selectedBodyTypeIndex, builder: (_, bodyType, __) { @@ -110,6 +111,7 @@ class LaserAppointment extends StatelessWidget { }); }, ), + SizedBox(height: 8.h), Selector>(selector: (_, vm) => vm.laserBodyPartsList, builder:(_, parts,__){ return BodyPartsListing( parts: parts, diff --git a/lib/presentation/book_appointment/laser/widgets/body_part_listing.dart b/lib/presentation/book_appointment/laser/widgets/body_part_listing.dart index c9578682..fb641327 100644 --- a/lib/presentation/book_appointment/laser/widgets/body_part_listing.dart +++ b/lib/presentation/book_appointment/laser/widgets/body_part_listing.dart @@ -1,9 +1,12 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.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/features/book_appointments/models/laser_body_parts_data.dart'; import 'package:hmg_patient_app_new/features/book_appointments/models/resp_models/laser_body_parts.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; @@ -70,7 +73,7 @@ class BodyPartsListing extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AspectRatio( - aspectRatio: 97 / 97, + aspectRatio: 130 / 120, child: FittedBox( fit: BoxFit.fitWidth, child: Stack( @@ -93,12 +96,12 @@ class BodyPartsListing extends StatelessWidget { Container( width: 18.h, height: 18.h, - child: Icon(Icons.done, - color: Colors.white, size: 12.h), decoration: BoxDecoration( color: AppColors.primaryRedColor, borderRadius: BorderRadius.circular(30.h), ), + child: Icon(Icons.done, + color: Colors.white, size: 12.h), ), ], ), @@ -106,17 +109,19 @@ class BodyPartsListing extends StatelessWidget { ), SizedBox(height: 6.h), Expanded( - child: Text( - context - .read() - .getLaserProcedureNameWRTLanguage(parts[index]), - style: TextStyle( - fontSize: 12.f, - fontWeight: FontWeight.w600, - color: Color(0xff2B353E), - letterSpacing: -0.48, + child: Center( + child: Column( + children: [ + context.read().getLaserProcedureNameWRTLanguage(parts[index]).toText12(isBold: true, color: AppColors.textColor, isCenter: true, maxLine: 2), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + "${LocaleKeys.mins.tr()}: ".toText12(isBold: true, color: AppColors.textColor, isCenter: true, maxLine: 2), + parts[index].timeDuration!.toText12(isBold: true, color: AppColors.textColor, isCenter: true, maxLine: 2), + ], + ), + ], ), - maxLines: 1, ), ), ], diff --git a/lib/presentation/book_appointment/review_appointment_page.dart b/lib/presentation/book_appointment/review_appointment_page.dart index 603aa757..5609eaf2 100644 --- a/lib/presentation/book_appointment/review_appointment_page.dart +++ b/lib/presentation/book_appointment/review_appointment_page.dart @@ -90,7 +90,7 @@ class _ReviewAppointmentPageState extends State { .toString() .toText16(isBold: true, maxlines: 1), SizedBox(width: 12.w), - bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL!.isNotEmpty ? Image.network( + (bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL != null && bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL!.isNotEmpty )? Image.network( bookAppointmentsViewModel.selectedDoctor.nationalityFlagURL ?? "https://hmgwebservices.com/Images/flag/SAU.png", width: 20.h, height: 15.h, diff --git a/lib/presentation/book_appointment/select_doctor_page.dart b/lib/presentation/book_appointment/select_doctor_page.dart index 7947fa05..5044adb1 100644 --- a/lib/presentation/book_appointment/select_doctor_page.dart +++ b/lib/presentation/book_appointment/select_doctor_page.dart @@ -220,7 +220,7 @@ class _SelectDoctorPageState extends State { ], ).paddingSymmetrical(0.h, 0.h), if (bookAppointmentsViewModel.isGetDocForHealthCal && bookAppointmentsVM.showSortFilterButtons) SizedBox(height: 16.h), - Row( + bookAppointmentsVM.selectedClinic.clinicID != 17 ? Row( mainAxisSize: MainAxisSize.max, children: [ Column( @@ -241,7 +241,7 @@ class _SelectDoctorPageState extends State { }, ), ], - ), + ) : SizedBox.shrink(), ListView.separated( padding: EdgeInsets.only(top: 16.h), shrinkWrap: true, diff --git a/lib/presentation/contact_us/contact_us.dart b/lib/presentation/contact_us/contact_us.dart index b6c45a62..c064a230 100644 --- a/lib/presentation/contact_us/contact_us.dart +++ b/lib/presentation/contact_us/contact_us.dart @@ -83,6 +83,8 @@ class ContactUs extends StatelessWidget { LocaleKeys.liveChatWithHMG.tr(), ).onPress(() { if (getIt.get().isAuthenticated) { + Navigator.of(context).pop(); + contactUsViewModel.getLiveChatProjectsList(); Navigator.of(context).push( CustomPageRoute( page: LiveChatPage(), diff --git a/lib/presentation/contact_us/live_chat_page.dart b/lib/presentation/contact_us/live_chat_page.dart index 0350c316..98fc9954 100644 --- a/lib/presentation/contact_us/live_chat_page.dart +++ b/lib/presentation/contact_us/live_chat_page.dart @@ -121,7 +121,9 @@ class LiveChatPage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - ("${appState.isArabic() ? contactUsVM.liveChatProjectsList[index].projectNameN! : contactUsVM.liveChatProjectsList[index].projectName!}\n${contactUsVM.liveChatProjectsList[index].distanceInKilometers!} KM") + ("${appState.isArabic() ? contactUsVM.liveChatProjectsList[index].projectNameN! : contactUsVM.liveChatProjectsList[index].projectName!}" + // "\n${contactUsVM.liveChatProjectsList[index].distanceInKilometers!} KM" + ) .toText14(isBold: true, color: contactUsVM.selectedLiveChatProjectIndex == index ? Colors.white : AppColors.textColor), Transform.flip( flipX: getIt.get().isArabic(), diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index dfb86a27..f4cc5ac8 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -365,6 +365,8 @@ class _LandingPageState extends State { ), ], ).paddingSymmetrical(24.h, 0.h).onPress(() { + myAppointmentsViewModel.onTabChange(0); + myAppointmentsViewModel.updateListWRTTab(0); Navigator.of(context).push(CustomPageRoute(page: MyAppointmentsPage())); }), Consumer3( diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart index 07b9fb65..6f68a6c1 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultList.dart @@ -27,7 +27,7 @@ class LabResultList extends StatelessWidget { shrinkWrap: true,itemCount: list.length,itemBuilder: (____, index) { var labItem = list[index]; return LabOrderResultItem(onTap: () { - model.getPatientLabResult(model.currentlySelectedPatientOrder!, labItem.description ?? "", labItem.testShortDescription!, labItem.uOM ?? ""); + model.getPatientLabResult(model.currentlySelectedPatientOrder!, labItem.description ?? "", labItem.testShortDescription ?? "", labItem.uOM ?? ""); }, tests: labItem, index: index, diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 3e440723..25603bdc 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -546,7 +546,7 @@ class _MedicalFilePageState extends State { doctorImageURL: patientAppointmentHistoryResponseModel.doctorImageURL, doctorTitle: patientAppointmentHistoryResponseModel.doctorTitle, name: patientAppointmentHistoryResponseModel.doctorNameObj, - nationalityFlagURL: "https://hmgwebservices.com/Images/flag/SYR.png", + nationalityFlagURL: "", speciality: [], clinicName: patientAppointmentHistoryResponseModel.clinicName, projectName: patientAppointmentHistoryResponseModel.projectName, @@ -1566,7 +1566,7 @@ class _MedicalFilePageState extends State { label: LocaleKeys.weight.tr(context: context), value: vitalSign.weightKg?.toString() ?? '--', unit: 'kg', - status: vitalSign.weightKg != null ? "Normal" : null, + status: vitalSign.weightKg != null ? _getWeightStatus(vitalSign.bodyMassIndex) : null, onTap: onTap, ), ), @@ -1593,6 +1593,11 @@ class _MedicalFilePageState extends State { return VitalSignUiModel.bmiStatus(bmi); } + String? _getWeightStatus(dynamic bmi) { + if (bmi == null) return 'Normal'; + return VitalSignUiModel.bmiStatus(bmi); + } + String? _getBloodPressureStatus({dynamic systolic, dynamic diastolic}) { return VitalSignUiModel.bloodPressureStatus(systolic: systolic, diastolic: diastolic); } diff --git a/lib/presentation/rate_appointment/rate_appointment_doctor.dart b/lib/presentation/rate_appointment/rate_appointment_doctor.dart index 8940f0fc..dfc15cd3 100644 --- a/lib/presentation/rate_appointment/rate_appointment_doctor.dart +++ b/lib/presentation/rate_appointment/rate_appointment_doctor.dart @@ -26,7 +26,7 @@ class RateAppointmentDoctor extends StatefulWidget { class _RateAppointmentDoctorState extends State { final formKey = GlobalKey(); String note = ""; - int rating = 5; + int rating = 0; // ProjectViewModel? projectViewModel; AppointmentRatingViewModel? appointmentRatingViewModel; @@ -145,7 +145,7 @@ class _RateAppointmentDoctorState extends State { decoration: InputDecoration.collapsed( hintText: LocaleKeys.notes.tr(context: context), hintStyle: TextStyle( - fontSize: 16, + fontSize: 16.f, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, diff --git a/lib/presentation/rate_appointment/widget/doctor_row.dart b/lib/presentation/rate_appointment/widget/doctor_row.dart index 725ac7c3..d85518f0 100644 --- a/lib/presentation/rate_appointment/widget/doctor_row.dart +++ b/lib/presentation/rate_appointment/widget/doctor_row.dart @@ -36,32 +36,26 @@ class BuildDoctorRow extends StatelessWidget { SizedBox(height: 8.h), - isForClinic ? Wrap( direction: Axis.horizontal, spacing: 3.h, runSpacing: 4.h, children: [ AppCustomChipWidget( - labelText: appointmentDetails!.clinicName.toString(), - ), AppCustomChipWidget( icon: AppAssets.ic_date_filter, labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(appointmentDetails!.appointmentDate), false), - ), AppCustomChipWidget( icon: AppAssets.appointment_time_icon, labelText: appointmentDetails!.startTime.substring(0, appointmentDetails!.startTime.length - 3), - ), - ] ) : Wrap( direction: Axis.horizontal, @@ -69,26 +63,26 @@ class BuildDoctorRow extends StatelessWidget { runSpacing: 4.h, children: [ AppCustomChipWidget( - labelText: appointmentDetails!.projectName.toString(), - - ), AppCustomChipWidget( - 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), + ), + ], + ), + ], + ), ), - ), ], - )); + ), + ); } } \ No newline at end of file diff --git a/lib/presentation/vital_sign/vital_sign_details_page.dart b/lib/presentation/vital_sign/vital_sign_details_page.dart index ca6e09a5..587a910f 100644 --- a/lib/presentation/vital_sign/vital_sign_details_page.dart +++ b/lib/presentation/vital_sign/vital_sign_details_page.dart @@ -89,6 +89,21 @@ class _VitalSignDetailsPageState extends State { ), _whatIsThisResultCard(context), _historyCard(context, history: history), + Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 16.r, + hasShadow: false, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.history.tr(context: context).toText16(isBold: true, color: AppColors.textColor), + SizedBox(height: 16.h), + _buildHistoryList(context, history), + ], + ).paddingSymmetrical(16.h, 16.h), + ), ], ).paddingAll(24.h), ); @@ -264,35 +279,27 @@ class _VitalSignDetailsPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - _isGraphVisible ? LocaleKeys.historyFlowchart.tr(context: context) : LocaleKeys.history.tr(context: context), - style: TextStyle( - fontSize: 16, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - color: AppColors.textColor, - ), - ), + LocaleKeys.historyFlowchart.tr(context: context).toText16(isBold: true, color: AppColors.textColor), Row( mainAxisSize: MainAxisSize.min, children: [ - Container( - width: 24.h, - height: 24.h, - alignment: Alignment.center, - child: InkWell( - onTap: () { - setState(() { - _isGraphVisible = !_isGraphVisible; - }); - }, - child: Utils.buildSvgWithAssets( - icon: _isGraphVisible ? AppAssets.ic_list : AppAssets.ic_graph, - width: 24.h, - height: 24.h, - ), - ), - ), + // Container( + // width: 24.h, + // height: 24.h, + // alignment: Alignment.center, + // child: InkWell( + // onTap: () { + // setState(() { + // _isGraphVisible = !_isGraphVisible; + // }); + // }, + // child: Utils.buildSvgWithAssets( + // icon: _isGraphVisible ? AppAssets.ic_list : AppAssets.ic_graph, + // width: 24.h, + // height: 24.h, + // ), + // ), + // ), // SizedBox(width: 16.h), // Container( // width: 24.h, @@ -663,7 +670,8 @@ class _VitalSignDetailsPageState extends State { case VitalSignMetric.height: return null; case VitalSignMetric.weight: - return latest.weightKg != null ? 'Normal' : null; + // return latest.weightKg != null ? 'Normal' : null; + return VitalSignUiModel.bmiStatus(latest.bodyMassIndex); case VitalSignMetric.temperature: return null; case VitalSignMetric.heartRate: diff --git a/lib/presentation/vital_sign/vital_sign_page.dart b/lib/presentation/vital_sign/vital_sign_page.dart index 82c64686..4fa90233 100644 --- a/lib/presentation/vital_sign/vital_sign_page.dart +++ b/lib/presentation/vital_sign/vital_sign_page.dart @@ -138,11 +138,13 @@ class _VitalSignPageState extends State { label: LocaleKeys.weight.tr(context: context), value: latestVitalSign?.weightKg?.toString() ?? '--', unit: 'kg', - status: (latestVitalSign?.weightKg != null) ? 'Normal' : null, + status: (latestVitalSign?.weightKg != null) + ? VitalSignUiModel.bmiStatus(latestVitalSign?.bodyMassIndex) + : null, onTap: () => _openDetails( VitalSignDetailsArgs( metric: VitalSignMetric.weight, - title: LocaleKeys.height.tr(context: context), + title: LocaleKeys.weight.tr(context: context), icon: AppAssets.weightVital, unit: 'kg', ), diff --git a/lib/widgets/common_bottom_sheet.dart b/lib/widgets/common_bottom_sheet.dart index bc52c0cc..9129962c 100644 --- a/lib/widgets/common_bottom_sheet.dart +++ b/lib/widgets/common_bottom_sheet.dart @@ -116,6 +116,7 @@ void showCommonBottomSheet(BuildContext context, Function(String?)? callBackFunc, String? title, required double height, + bool isAutoDismiss = false, bool isCloseButtonVisible = true, bool isFullScreen = true, bool isDismissible = true, @@ -131,6 +132,14 @@ void showCommonBottomSheet(BuildContext context, isDismissible: isDismissible, backgroundColor: isSuccessDialog ? AppColors.whiteColor : AppColors.scaffoldBgColor, builder: (BuildContext context) { + if (isAutoDismiss) { + Future.delayed(Duration(seconds: 2), () { + Navigator.of(context).pop(); + if (callBackFunc != null) { + callBackFunc(null); + } + }); + } return Container( height: height, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.scaffoldBgColor, borderRadius: 24.h), @@ -214,6 +223,7 @@ void showCommonBottomSheetWithoutHeight( bool isCloseButtonVisible = true, bool isFullScreen = true, bool isDismissible = true, + bool isAutoDismiss = false, Widget? titleWidget, bool useSafeArea = false, bool hasBottomPadding = true, @@ -237,6 +247,14 @@ void showCommonBottomSheetWithoutHeight( backgroundColor: resolvedBgColor, useSafeArea: useSafeArea, builder: (BuildContext context) { + if (isAutoDismiss) { + Future.delayed(Duration(seconds: 2), () { + Navigator.of(context).pop(); + if (callBackFunc != null) { + callBackFunc(); + } + }); + } return SafeArea( top: false, left: false,