TF-3295 Fix BLUE-BAR attendees mail addresses are not clickable
This commit is contained in:
@@ -361,6 +361,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
calendarEventReplying: controller.calendarEventProcessing,
|
||||
presentationEmail: controller.currentEmail,
|
||||
onMailtoAttendeesAction: controller.handleMailToAttendees,
|
||||
openEmailAddressDetailAction: controller.openEmailAddressDialog,
|
||||
)),
|
||||
if (_validateDisplayEventActionBanner(
|
||||
context: context,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
import 'package:jmap_dart_client/jmap/mail/calendar/properties/calendar_organizer.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
|
||||
extension CalendarOrganierExtension on CalendarOrganizer {
|
||||
EmailAddress toEmailAddress() {
|
||||
return EmailAddress(
|
||||
name, mailto?.value,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,22 @@
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/calendar/properties/attendee/calendar_attendee.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_attendee_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/attendee_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_sender_builder.dart';
|
||||
|
||||
class AttendeeWidget extends StatelessWidget {
|
||||
|
||||
final CalendarAttendee attendee;
|
||||
final List<CalendarAttendee> listAttendees;
|
||||
final OnOpenEmailAddressDetailAction? openEmailAddressDetailAction;
|
||||
|
||||
const AttendeeWidget({
|
||||
super.key,
|
||||
required this.attendee,
|
||||
required this.listAttendees,
|
||||
this.openEmailAddressDetailAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -34,6 +39,7 @@ class AttendeeWidget extends StatelessWidget {
|
||||
fontSize: AttendeeWidgetStyles.textSize,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
recognizer: TapGestureRecognizer()..onTap = () => _onClickMailAddress(context)
|
||||
),
|
||||
if (listAttendees.last != attendee)
|
||||
const TextSpan(text: ', '),
|
||||
@@ -41,4 +47,8 @@ class AttendeeWidget extends StatelessWidget {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void _onClickMailAddress(BuildContext context) {
|
||||
openEmailAddressDetailAction?.call(context, attendee.toEmailAddress());
|
||||
}
|
||||
}
|
||||
+5
@@ -15,6 +15,7 @@ import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_location_information_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_time_information_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_title_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_sender_builder.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
@@ -30,6 +31,7 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
final bool calendarEventReplying;
|
||||
final PresentationEmail? presentationEmail;
|
||||
final OnMailtoAttendeesAction? onMailtoAttendeesAction;
|
||||
final OnOpenEmailAddressDetailAction? openEmailAddressDetailAction;
|
||||
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
|
||||
@@ -42,6 +44,7 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
this.onOpenComposerAction,
|
||||
this.presentationEmail,
|
||||
this.onMailtoAttendeesAction,
|
||||
this.openEmailAddressDetailAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -130,6 +133,7 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
child: EventAttendeeDetailWidget(
|
||||
attendees: calendarEvent.participants ?? [],
|
||||
organizer: calendarEvent.organizer,
|
||||
openEmailAddressDetailAction: openEmailAddressDetailAction,
|
||||
),
|
||||
),
|
||||
if (calendarEvent.isDisplayedEventReplyAction)
|
||||
@@ -215,6 +219,7 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
child: EventAttendeeDetailWidget(
|
||||
attendees: calendarEvent.participants ?? [],
|
||||
organizer: calendarEvent.organizer,
|
||||
openEmailAddressDetailAction: openEmailAddressDetailAction,
|
||||
),
|
||||
),
|
||||
if (calendarEvent.isDisplayedEventReplyAction)
|
||||
|
||||
+13
-3
@@ -9,6 +9,7 @@ import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/hide_all_attendees_button_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/organizer_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/see_all_attendees_button_widget.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_sender_builder.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class EventAttendeeDetailWidget extends StatefulWidget {
|
||||
@@ -17,11 +18,13 @@ class EventAttendeeDetailWidget extends StatefulWidget {
|
||||
|
||||
final List<CalendarAttendee> attendees;
|
||||
final CalendarOrganizer? organizer;
|
||||
final OnOpenEmailAddressDetailAction? openEmailAddressDetailAction;
|
||||
|
||||
const EventAttendeeDetailWidget({
|
||||
super.key,
|
||||
required this.attendees,
|
||||
required this.organizer
|
||||
required this.organizer,
|
||||
this.openEmailAddressDetailAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -61,10 +64,17 @@ class _EventAttendeeDetailWidgetState extends State<EventAttendeeDetailWidget> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (widget.organizer != null)
|
||||
OrganizerWidget(organizer: widget.organizer!),
|
||||
OrganizerWidget(
|
||||
organizer: widget.organizer!,
|
||||
openEmailAddressDetailAction: widget.openEmailAddressDetailAction
|
||||
),
|
||||
if (_attendeesDisplayed.isNotEmpty)
|
||||
..._attendeesDisplayed
|
||||
.map((attendee) => AttendeeWidget(attendee: attendee, listAttendees: _attendeesDisplayed))
|
||||
.map((attendee) => AttendeeWidget(
|
||||
attendee: attendee,
|
||||
listAttendees: _attendeesDisplayed,
|
||||
openEmailAddressDetailAction: widget.openEmailAddressDetailAction
|
||||
))
|
||||
.toList(),
|
||||
if (!_isShowAllAttendee)
|
||||
Padding(
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/calendar/properties/calendar_organizer.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_organier_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/organizer_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/email_sender_builder.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class OrganizerWidget extends StatelessWidget {
|
||||
|
||||
final CalendarOrganizer organizer;
|
||||
final OnOpenEmailAddressDetailAction? openEmailAddressDetailAction;
|
||||
|
||||
const OrganizerWidget({
|
||||
super.key,
|
||||
required this.organizer
|
||||
required this.organizer,
|
||||
this.openEmailAddressDetailAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -33,6 +38,7 @@ class OrganizerWidget extends StatelessWidget {
|
||||
fontSize: OrganizerWidgetStyles.textSize,
|
||||
fontWeight: FontWeight.w500
|
||||
),
|
||||
recognizer: TapGestureRecognizer()..onTap = () => _onClickMailAddress(context)
|
||||
),
|
||||
TextSpan(text: '(${AppLocalizations.of(context).organizer})'),
|
||||
const TextSpan(text: ', '),
|
||||
@@ -40,4 +46,8 @@ class OrganizerWidget extends StatelessWidget {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void _onClickMailAddress(BuildContext context) {
|
||||
openEmailAddressDetailAction?.call(context, organizer.toEmailAddress());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user