diff --git a/assets/images/png/default_MEP.png b/assets/images/png/default_MEP.png new file mode 100644 index 00000000..d79b58d2 Binary files /dev/null and b/assets/images/png/default_MEP.png differ diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart index 8c57598e..44ca3b10 100644 --- a/lib/core/app_assets.dart +++ b/lib/core/app_assets.dart @@ -400,6 +400,7 @@ class AppAssets { static const String fullBodyFrontFemale = '$pngBasePath/full_body_front_female.png'; static const String fullBodyBackFemale = '$pngBasePath/full_body_back_female.png'; static const String bmiFullBody = '$pngBasePath/bmi_image_1.png'; + static const String defaultMEP = '$pngBasePath/default_MEP.png'; } class AppAnimations { diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index ac7af39d..bc4b82c0 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -923,7 +923,8 @@ class Utils { ), TextSpan( // text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount), - text: " ${habibWalletAmount.toStringAsFixed(2)}", + // text: " ${(NumberFormat.decimalPattern().format(habibWalletAmount)).toStringAsFixed(2)}", + text: " ${(NumberFormat.decimalPattern().format(habibWalletAmount))}", style: TextStyle( color: resolvedTextColor, fontSize: fontSize ?? 32.f, diff --git a/lib/features/blood_donation/blood_donation_view_model.dart b/lib/features/blood_donation/blood_donation_view_model.dart index 8ad5bdec..7aa67d4f 100644 --- a/lib/features/blood_donation/blood_donation_view_model.dart +++ b/lib/features/blood_donation/blood_donation_view_model.dart @@ -1,11 +1,14 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:get_it/get_it.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/doctor_response_mapper.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/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/blood_donation/blood_donation_repo.dart'; import 'package:hmg_patient_app_new/features/blood_donation/models/blood_group_hospitals_model.dart'; @@ -20,6 +23,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; +import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; class BloodDonationViewModel extends ChangeNotifier { @@ -263,7 +267,13 @@ class BloodDonationViewModel extends ChangeNotifier { await bloodDonationRepo.updateBloodGroup(request: payload); await addUserAgreementForBloodDonation(); LoaderBottomSheet.hideLoader(); - dialogService.showSuccessBottomSheetWithoutH(message: "Blood Group Updated Successfully", onOkPressed: () {}); + showCommonBottomSheetWithoutHeight(GetIt.instance().navigatorKey.currentContext!, + child: Utils.getSuccessWidget(loadingText: "Blood Group Updated Successfully").paddingSymmetrical(0.h, 24.h), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: false, + isAutoDismiss: true); + // dialogService.showSuccessBottomSheetWithoutH(message: "Blood Group Updated Successfully", onOkPressed: () {}); } Future addUserAgreementForBloodDonation() async { diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index 1b49b0ca..73f8d331 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -676,9 +676,9 @@ class MyAppointmentsViewModel extends ChangeNotifier { Future getPatientFavouriteDoctors({bool forceRefresh = false, Function(dynamic)? onSuccess, Function(String)? onError}) async { // If data is already fetched and not forcing refresh, skip API call - if (isFavouriteDoctorsDataFetched && !forceRefresh) { - return; - } + // if (isFavouriteDoctorsDataFetched && !forceRefresh) { + // return; + // } isPatientFavouriteDoctorsLoading = true; patientFavouriteDoctorsList.clear(); diff --git a/lib/features/prescriptions/models/resp_models/prescription_detail_response_model.dart b/lib/features/prescriptions/models/resp_models/prescription_detail_response_model.dart index b35cfef7..ef1bc6f7 100644 --- a/lib/features/prescriptions/models/resp_models/prescription_detail_response_model.dart +++ b/lib/features/prescriptions/models/resp_models/prescription_detail_response_model.dart @@ -33,6 +33,7 @@ class PrescriptionDetailResponseModel { num? scaleOffset; String? startDate; bool? hasReminder; + bool? isHomeMedicineDeliverySupported; PrescriptionDetailResponseModel( {this.address, @@ -68,7 +69,7 @@ class PrescriptionDetailResponseModel { this.sKU, this.scaleOffset, this.startDate, - this.hasReminder = false}); + this.hasReminder = false, this.isHomeMedicineDeliverySupported}); PrescriptionDetailResponseModel.fromJson(Map json) { address = json['Address']; diff --git a/lib/features/prescriptions/prescriptions_repo.dart b/lib/features/prescriptions/prescriptions_repo.dart index 3bfcc7fe..387d6410 100644 --- a/lib/features/prescriptions/prescriptions_repo.dart +++ b/lib/features/prescriptions/prescriptions_repo.dart @@ -99,7 +99,11 @@ class PrescriptionsRepoImp implements PrescriptionsRepo { // throw Exception("prescription list is empty"); } - final prescriptionOrders = list.map((item) => PrescriptionDetailResponseModel.fromJson(item as Map)).toList().cast(); + final List prescriptionOrders = + list.map((item) => PrescriptionDetailResponseModel.fromJson(item as Map)).toList().cast(); + if (prescriptionOrders.isNotEmpty) { + prescriptionOrders.first.isHomeMedicineDeliverySupported = response['IsHomeMedicineDeliverySupported'] ?? false; + } apiResponse = GenericApiModel>( messageStatus: messageStatus, diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index c0b469b4..2aff4f4c 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -554,7 +554,7 @@ class _AppointmentDetailsPageState extends State { clinicDescription: widget.patientAppointmentHistoryResponseModel.clinicName, decimalDoctorRate: widget.patientAppointmentHistoryResponseModel.decimalDoctorRate, name: widget.patientAppointmentHistoryResponseModel.projectName, - isHomeMedicineDeliverySupported: false, + isHomeMedicineDeliverySupported: val.data.first.isHomeMedicineDeliverySupported ?? false, projectID: widget.patientAppointmentHistoryResponseModel.projectID, clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, doctorID: widget.patientAppointmentHistoryResponseModel.doctorID, @@ -642,6 +642,13 @@ class _AppointmentDetailsPageState extends State { ); }, ), + callBackFunc: () { + myAppointmentsViewModel.getDoctorsRatingCheck( + doctorID: widget.patientAppointmentHistoryResponseModel.doctorID, + clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, + projectID: widget.patientAppointmentHistoryResponseModel.projectID, + appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo); + }, isFullScreen: false, ); } diff --git a/lib/presentation/appointments/widgets/appointment_rating_widget.dart b/lib/presentation/appointments/widgets/appointment_rating_widget.dart index 735895a0..11fed46a 100644 --- a/lib/presentation/appointments/widgets/appointment_rating_widget.dart +++ b/lib/presentation/appointments/widgets/appointment_rating_widget.dart @@ -165,7 +165,6 @@ class _AppointmentRatingWidgetState extends State { // await appointmentRatingViewModel!.submitClinicRating(clinicRate: rating, clinicNote: note); LoaderBottomSheet.hideLoader(); Navigator.pop(context); - setState(() {}); }, ), diff --git a/lib/presentation/health_trackers/add_health_tracker_entry_page.dart b/lib/presentation/health_trackers/add_health_tracker_entry_page.dart index 89217aca..2d0356c3 100644 --- a/lib/presentation/health_trackers/add_health_tracker_entry_page.dart +++ b/lib/presentation/health_trackers/add_health_tracker_entry_page.dart @@ -159,14 +159,12 @@ class _AddHealthTrackerEntryPageState extends State { context, child: Utils.getSuccessWidget( loadingText: _getSuccessMessage(), - ), - callBackFunc: () { - Navigator.pop(context); - }, + ).paddingSymmetrical(0.h, 24.h), callBackFunc: () { + // Navigator.pop(context); + }, isCloseButtonVisible: false, isDismissible: true, - isFullScreen: false, - ); + isFullScreen: false, isAutoDismiss: true); } // Reusable method to build selection row widget diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index 680bf1c7..a2a3a4bf 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -430,6 +430,7 @@ class ServicesPage extends StatelessWidget { title: LandingPageData.getServiceCardsList[index].title, subtitle: LandingPageData.getServiceCardsList[index].subtitle, icon: LandingPageData.getServiceCardsList[index].largeCardIcon, + isPNG: LandingPageData.getServiceCardsList[index].isPNG, ), ), ), @@ -471,7 +472,7 @@ class ServicesPage extends StatelessWidget { Spacer(), getIt.get().isAuthenticated ? Consumer(builder: (context, habibWalletVM, child) { - return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), isExpanded: false) + return Utils.getPaymentAmountWithSymbol2(num.parse(NumberFormat.decimalPattern().format(habibWalletVM.habibWalletAmount)), isExpanded: false, letterSpacing: -1) .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h); }) : LocaleKeys.loginToViewWalletBalance.tr().toText12(isBold: true, maxLine: 2), diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart index 00142c23..a60a7c18 100644 --- a/lib/presentation/home/data/landing_page_data.dart +++ b/lib/presentation/home/data/landing_page_data.dart @@ -164,6 +164,7 @@ class LandingPageData { backgroundColor: AppColors.successColor, iconColor: AppColors.whiteColor, isBold: false, + isPNG: false ), // ServiceCardData( // icon: AppAssets.homeBottom, @@ -182,16 +183,18 @@ class LandingPageData { backgroundColor: AppColors.primaryRedColor, iconColor: AppColors.whiteColor, isBold: false, + isPNG: false ), ServiceCardData( serviceName: "pharmacy", - icon: AppAssets.pharmacy_icon, //359846 + icon: AppAssets.defaultMEP, //359846 title: LocaleKeys.hmgPharmacy, subtitle: LocaleKeys.hmgPharmacyText, largeCardIcon: AppAssets.pharmacyService, backgroundColor: AppColors.pharmacyBGColor, iconColor: null, isBold: true, + isPNG: true ), ]; } diff --git a/lib/presentation/home/data/service_card_data.dart b/lib/presentation/home/data/service_card_data.dart index c16147b1..f2f1d121 100644 --- a/lib/presentation/home/data/service_card_data.dart +++ b/lib/presentation/home/data/service_card_data.dart @@ -12,6 +12,7 @@ class ServiceCardData { final Color? backgroundColor; final bool isBold; final String largeCardIcon; + final bool isPNG; ServiceCardData({ this.serviceName = "", @@ -22,6 +23,7 @@ class ServiceCardData { this.backgroundColor, this.iconColor, this.textColor, - this.isBold = false + this.isBold = false, + this.isPNG = false, }); } diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index e61b6226..f92c8a87 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -204,7 +204,7 @@ class _LandingPageState extends State { // Refresh Appointments Data myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true); myAppointmentsViewModel.initAppointmentsViewModel(); - myAppointmentsViewModel.getPatientAppointments(true, true); + myAppointmentsViewModel.getPatientAppointments(true, false); // Refresh Appointments Data habibWalletVM.initHabibWalletProvider(); @@ -822,6 +822,7 @@ class _LandingPageState extends State { title: LandingPageData.getServiceCardsList[index].title, subtitle: LandingPageData.getServiceCardsList[index].subtitle, icon: LandingPageData.getServiceCardsList[index].largeCardIcon, + isPNG: LandingPageData.getServiceCardsList[index].isPNG, ), ), ), diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index fd6676f9..208d54b8 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -28,6 +28,7 @@ class LargeServiceCard extends StatelessWidget { final String icon; final String title; final String subtitle; + final bool isPNG; const LargeServiceCard({ super.key, @@ -36,6 +37,7 @@ class LargeServiceCard extends StatelessWidget { this.icon = "", this.title = "", this.subtitle = "", + this.isPNG = false, }); @override @@ -72,7 +74,7 @@ class LargeServiceCard extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( + isPNG ? Image.asset(serviceCardData.icon, width: 35.h, height: 35.h) : Container( height: 48.h, width: 48.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( @@ -172,6 +174,7 @@ class FadedLargeServiceCard extends StatelessWidget { final String icon; final String title; final String subtitle; + final bool isPNG; const FadedLargeServiceCard({ super.key, @@ -180,6 +183,7 @@ class FadedLargeServiceCard extends StatelessWidget { this.icon = "", this.title = "", this.subtitle = "", + this.isPNG = false, }); @override @@ -225,7 +229,7 @@ class FadedLargeServiceCard extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( + isPNG ? Image.asset(serviceCardData.icon, width: 35.h, height: 35.h) : Container( height: 32.h, width: 32.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 7bbfc936..b5e3ef49 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -979,7 +979,7 @@ class _MedicalFilePageState extends State { ), ).paddingSymmetrical(0.w, 0.h) : SizedBox( - height: 100.h, + height: 110.h, child: ListView.separated( scrollDirection: Axis.horizontal, itemCount: myAppointmentsVM.patientMyDoctorsList.length, @@ -1003,7 +1003,8 @@ class _MedicalFilePageState extends State { fit: BoxFit.cover, ).circle(100).toShimmer2(isShow: false, radius: 50.r), SizedBox(height: 8.h), - Expanded( + SizedBox( + width: 80.w, child: (myAppointmentsVM.patientMyDoctorsList[index].doctorName) .toString().toText12(isBold: true, isCenter: true, maxLine: 2).toShimmer2(isShow: false), ), diff --git a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart index 51e0cc15..bbe01d5a 100644 --- a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart +++ b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart @@ -163,25 +163,27 @@ class MedicalFileAppointmentCard extends StatelessWidget { } Widget getArrivedAppointmentButton(BuildContext context) { - return DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15 - ? CustomButton( - text: LocaleKeys.askDoctor.tr(context: context), - onPressed: () { - onAskDoctorTap(); - }, - backgroundColor: AppColors.secondaryLightRedColor, - borderColor: AppColors.secondaryLightRedColor, - textColor: AppColors.primaryRedColor, - fontSize: 14.f, - fontWeight: FontWeight.w600, - borderRadius: 12.r, - padding: EdgeInsets.symmetric(horizontal: 10.w), - height: 40.h, - icon: AppAssets.ask_doctor_icon, - iconColor: AppColors.primaryRedColor, - iconSize: 16.h, - ) - : CustomButton( + return + // DateTime.now().difference(DateUtil.convertStringToDate(patientAppointmentHistoryResponseModel.appointmentDate)).inDays <= 15 + // ? CustomButton( + // text: LocaleKeys.askDoctor.tr(context: context), + // onPressed: () { + // onAskDoctorTap(); + // }, + // backgroundColor: AppColors.secondaryLightRedColor, + // borderColor: AppColors.secondaryLightRedColor, + // textColor: AppColors.primaryRedColor, + // fontSize: 14.f, + // fontWeight: FontWeight.w600, + // borderRadius: 12.r, + // padding: EdgeInsets.symmetric(horizontal: 10.w), + // height: 40.h, + // icon: AppAssets.ask_doctor_icon, + // iconColor: AppColors.primaryRedColor, + // iconSize: 16.h, + // ) + // : + CustomButton( text: LocaleKeys.rebook.tr(context: context), onPressed: () { onRescheduleTap();