TF-2068 Remove the comma of the last attendee in EventAttendeeDetailWidget

(cherry picked from commit 48906b1ac2d0e1ef978e410b0ba2719769c7fa19)
This commit is contained in:
dab246
2023-08-03 10:56:33 +07:00
committed by Dat Vu
parent 9ee40751e8
commit 0388e4eef7
2 changed files with 6 additions and 3 deletions
@@ -6,10 +6,12 @@ import 'package:tmail_ui_user/features/email/presentation/styles/attendee_widget
class AttendeeWidget extends StatelessWidget { class AttendeeWidget extends StatelessWidget {
final CalendarAttendee attendee; final CalendarAttendee attendee;
final List<CalendarAttendee> listAttendees;
const AttendeeWidget({ const AttendeeWidget({
super.key, super.key,
required this.attendee required this.attendee,
required this.listAttendees,
}); });
@override @override
@@ -33,7 +35,8 @@ class AttendeeWidget extends StatelessWidget {
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
), ),
), ),
const TextSpan(text: ', '), if (listAttendees.last != attendee)
const TextSpan(text: ', '),
] ]
) )
); );
@@ -61,7 +61,7 @@ class _EventAttendeeDetailWidgetState extends State<EventAttendeeDetailWidget> {
children: [ children: [
OrganizerWidget(organizer: widget.organizer), OrganizerWidget(organizer: widget.organizer),
..._attendeesDisplayed ..._attendeesDisplayed
.map((attendee) => AttendeeWidget(attendee: attendee)) .map((attendee) => AttendeeWidget(attendee: attendee, listAttendees: _attendeesDisplayed))
.toList(), .toList(),
if (!_isShowAllAttendee) if (!_isShowAllAttendee)
Padding( Padding(