diff --git a/lib/features/email/presentation/extensions/calendar_event_extension.dart b/lib/features/email/presentation/extensions/calendar_event_extension.dart index 1c7868b40..aec40e3ca 100644 --- a/lib/features/email/presentation/extensions/calendar_event_extension.dart +++ b/lib/features/email/presentation/extensions/calendar_event_extension.dart @@ -356,4 +356,8 @@ extension CalendarEventExtension on CalendarEvent { } return []; } + + bool get isDisplayedEventReplyAction => method != null + && organizer != null + && participants?.isNotEmpty == true; } \ No newline at end of file diff --git a/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart b/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart index 748bb307c..4cebe466c 100644 --- a/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart +++ b/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart @@ -101,15 +101,16 @@ class CalendarEventDetailWidget extends StatelessWidget { organizer: calendarEvent.organizer!, ), ), - CalendarEventActionButtonWidget( - onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, - calendarEventReplying: calendarEventReplying, - presentationEmail: presentationEmail, - onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( - calendarEvent.organizer, - calendarEvent.participants, + if (calendarEvent.isDisplayedEventReplyAction) + CalendarEventActionButtonWidget( + onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, + calendarEventReplying: calendarEventReplying, + presentationEmail: presentationEmail, + onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( + calendarEvent.organizer, + calendarEvent.participants, + ), ), - ), ], ), ); diff --git a/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart b/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart index fb65d3f25..f3f708b74 100644 --- a/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart +++ b/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart @@ -120,16 +120,17 @@ class CalendarEventInformationWidget extends StatelessWidget { organizer: calendarEvent.organizer!, ), ), - CalendarEventActionButtonWidget( - margin: EdgeInsetsDirectional.zero, - onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, - calendarEventReplying: calendarEventReplying, - presentationEmail: presentationEmail, - onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( - calendarEvent.organizer, - calendarEvent.participants, + if (calendarEvent.isDisplayedEventReplyAction) + CalendarEventActionButtonWidget( + margin: EdgeInsetsDirectional.zero, + onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, + calendarEventReplying: calendarEventReplying, + presentationEmail: presentationEmail, + onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( + calendarEvent.organizer, + calendarEvent.participants, + ), ), - ), ], ), ) @@ -195,16 +196,17 @@ class CalendarEventInformationWidget extends StatelessWidget { organizer: calendarEvent.organizer!, ), ), - CalendarEventActionButtonWidget( - margin: EdgeInsetsDirectional.zero, - onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, - calendarEventReplying: calendarEventReplying, - presentationEmail: presentationEmail, - onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( - calendarEvent.organizer, - calendarEvent.participants, + if (calendarEvent.isDisplayedEventReplyAction) + CalendarEventActionButtonWidget( + margin: EdgeInsetsDirectional.zero, + onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, + calendarEventReplying: calendarEventReplying, + presentationEmail: presentationEmail, + onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( + calendarEvent.organizer, + calendarEvent.participants, + ), ), - ), ], ), ))