diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 2aff4f4c..ef3b0c94 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -559,6 +559,10 @@ class _AppointmentDetailsPageState extends State { clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, doctorID: widget.patientAppointmentHistoryResponseModel.doctorID, setupID: widget.patientAppointmentHistoryResponseModel.setupID, + isInOutPatient: widget.patientAppointmentHistoryResponseModel.isInOutPatient, + appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo, + episodeID: widget.patientAppointmentHistoryResponseModel.episodeID, + dischargeNo: 0, ); Navigator.of(context).push( CustomPageRoute( diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index f92c8a87..f103bd3f 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -703,7 +703,7 @@ class _LandingPageState extends State { itemBuilder: (context, index) { return AnimationConfiguration.staggeredList( position: index, - duration: const Duration(milliseconds: 500), + duration: const Duration(milliseconds: 200), child: SlideAnimation( horizontalOffset: 100.0, child: FadeInAnimation( diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index 208d54b8..c36f7a90 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -229,7 +229,7 @@ class FadedLargeServiceCard extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - isPNG ? Image.asset(serviceCardData.icon, width: 35.h, height: 35.h) : Container( + isPNG ? Image.asset(serviceCardData.icon, width: 32.h, height: 32.h).circle(100.h) : Container( height: 32.h, width: 32.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( diff --git a/lib/presentation/medical_file/patient_sickleaves_list_page.dart b/lib/presentation/medical_file/patient_sickleaves_list_page.dart index dd7942d5..42d94ce7 100644 --- a/lib/presentation/medical_file/patient_sickleaves_list_page.dart +++ b/lib/presentation/medical_file/patient_sickleaves_list_page.dart @@ -169,8 +169,8 @@ class _PatientSickleavesListPageState extends State { richText: Row( mainAxisSize: MainAxisSize.min, children: [ - "${model.patientSickLeaveList[index].sickLeaveDays} ".toText10(isEnglishOnly: true), - LocaleKeys.days.tr(context: context).toText10() + "${model.patientSickLeaveList[index].sickLeaveDays} ".toText10(isBold: true), + LocaleKeys.days.tr(context: context).toText10(isBold: true) ], ), // labelText: "${model.patientSickLeaveList[index].sickLeaveDays} ${LocaleKeys.days.tr(context: context)}", 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 bbe01d5a..13ea39dd 100644 --- a/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart +++ b/lib/presentation/medical_file/widgets/medical_file_appointment_card.dart @@ -108,7 +108,7 @@ class MedicalFileAppointmentCard extends StatelessWidget { borderColor: AppointmentType.getNextActionButtonColor(patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), textColor: AppointmentType.getNextActionTextColor(patientAppointmentHistoryResponseModel.nextAction), fontSize: 14.f, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w600, borderRadius: 12.r, padding: EdgeInsets.symmetric(horizontal: 10.w), height: 40.h, @@ -118,8 +118,13 @@ class MedicalFileAppointmentCard extends StatelessWidget { ).toShimmer2(isShow: myAppointmentsViewModel.isMyAppointmentsLoading), ), SizedBox(width: 8.w), - Expanded( - flex: 2, + ((((patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) || + (patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) || + !Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) && + AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) + ? SizedBox.shrink() + : Expanded( + flex: 2, child: Container( height: 40.h, width: 40.w, @@ -163,42 +168,75 @@ 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( - text: LocaleKeys.rebook.tr(context: context), - onPressed: () { - onRescheduleTap(); - }, - backgroundColor: AppColors.greyColor, - borderColor: AppColors.greyColor, - textColor: AppColors.blackColor, - fontSize: 14.f, - fontWeight: FontWeight.w600, - borderRadius: 12.r, - padding: EdgeInsets.symmetric(horizontal: 10.w), - height: 40.h, - icon: AppAssets.rebook_appointment_icon, - iconColor: AppColors.blackColor, - iconSize: 16.h, - ); + if ((((patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false) || + (patientAppointmentHistoryResponseModel.isExecludeDoctor ?? false) || + !Utils.isClinicAllowedForRebook(patientAppointmentHistoryResponseModel.clinicID ?? 0))) && + AppointmentType.isArrived(patientAppointmentHistoryResponseModel)) { + return CustomButton( + text: LocaleKeys.viewDetails.tr(context: context), + onPressed: () { + Navigator.of(context) + .push( + CustomPageRoute( + page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel), + ), + ) + .then((_) { + myAppointmentsViewModel.initAppointmentsViewModel(); + myAppointmentsViewModel.getPatientAppointments(true, false); + }); + }, + backgroundColor: AppColors.secondaryLightRedColor, + borderColor: AppColors.secondaryLightRedColor, + textColor: AppColors.primaryRedColor, + fontSize: (isFoldable || isTablet) ? 12.f : 14.f, + fontWeight: FontWeight.w600, + borderRadius: 12.r, + padding: EdgeInsets.symmetric(horizontal: 10.w), + // height: isTablet || isFoldable ? 46.h : 40.h, + height: 40.h, + icon: null, + iconColor: AppColors.primaryRedColor, + iconSize: 16.h, + ); + } else { + 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(); + }, + backgroundColor: AppColors.greyColor, + borderColor: AppColors.greyColor, + textColor: AppColors.blackColor, + fontSize: 14.f, + fontWeight: FontWeight.w600, + borderRadius: 12.r, + padding: EdgeInsets.symmetric(horizontal: 10.w), + height: 40.h, + icon: AppAssets.rebook_appointment_icon, + iconColor: AppColors.blackColor, + iconSize: 16.h, + ); + } } } diff --git a/lib/presentation/prescriptions/prescription_detail_page.dart b/lib/presentation/prescriptions/prescription_detail_page.dart index b3d37664..715b6e4d 100644 --- a/lib/presentation/prescriptions/prescription_detail_page.dart +++ b/lib/presentation/prescriptions/prescription_detail_page.dart @@ -251,6 +251,9 @@ class _PrescriptionDetailPageState extends State { await prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel, onSuccess: (val) { LoaderBottomSheet.hideLoader(); prescriptionsViewModel.initiatePrescriptionDelivery(); + }, onError: (err) { + LoaderBottomSheet.hideLoader(); + print(err); }); } }, diff --git a/lib/widgets/buttons/custom_button.dart b/lib/widgets/buttons/custom_button.dart index cf9799f0..e8eea290 100644 --- a/lib/widgets/buttons/custom_button.dart +++ b/lib/widgets/buttons/custom_button.dart @@ -84,7 +84,22 @@ class CustomButton extends StatelessWidget { padding: text.isNotEmpty ? EdgeInsets.only(right: 4.w, left: 4.w) : EdgeInsets.zero, child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isButtonDisabled, width: iconS, height: iconS, applyThemeColor: applyThemeColor), ), - if (text.isNotEmpty) + if (text.isNotEmpty && icon != null) + Expanded( + child: Text( + text, + overflow: textOverflow ?? TextOverflow.ellipsis, + maxLines: 1, + textAlign: TextAlign.center, + style: context.dynamicTextStyle( + fontSize: fontS, + color: isButtonDisabled ? AppColors.greyTextColor : textColor, + letterSpacing: 0, + fontWeight: isBold ? FontWeight.w700 : fontWeight, + ), + ), + ), + if (text.isNotEmpty && icon == null) Text( text, overflow: textOverflow ?? TextOverflow.ellipsis,