diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 31cd5403..c668ebff 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -912,9 +912,9 @@ class _AppointmentDetailsPageState extends State { ], ).paddingOnly(left: 16.h, top: 24.h, right: 16.h, bottom: 0.h), AppointmentType.isArrived(widget.patientAppointmentHistoryResponseModel) - ? - (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! || - widget.patientAppointmentHistoryResponseModel.isExecludeDoctor! || + ? (!(widget.patientAppointmentHistoryResponseModel.isActiveDoctor ?? true) || + widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! || + widget.patientAppointmentHistoryResponseModel.isExecludeDoctor! || !Utils.isClinicAllowedForRebook(widget.patientAppointmentHistoryResponseModel.clinicID)) ? SizedBox.shrink() : CustomButton( diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 4f50bae9..0542f76d 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -390,8 +390,9 @@ class AppointmentCard extends StatelessWidget { ); } } - return Row( - children: [ + return (patientAppointmentHistoryResponseModel.isActiveDoctor ?? true) + ? Row( + children: [ Expanded( flex: 6, child: (AppointmentType.isArrived(patientAppointmentHistoryResponseModel) @@ -441,7 +442,34 @@ class AppointmentCard extends StatelessWidget { }), ), ], - ); + ) + : 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: isFromMedicalReport ? AppAssets.checkmark_icon : null, + iconColor: AppColors.primaryRedColor, + iconSize: 16.h, + ); } }