inviteDeclinedMessage function
- BuildContext context,
- Notification notification
Message builder for NotificationType.inviteDeclined.
Implementation
Widget inviteDeclinedMessage(BuildContext context, Notification notification) {
final plan = context.watch<CalendarPlanRepository>();
final users = context.watch<UsersRepository>();
return FutureBuilder(
future: plan.getInvites(id: notification.context),
builder: (context, snapshot) {
final invite = snapshot.data?.firstOrNull;
final userName = invite != null
? users.state.data
?.filter(
ids: [
invite.invitedUserId,
],
)
.firstOrNull
?.fullname
: null;
return Skeletonizer(
enabled: userName == null || notification.context == null,
child: Text(
'$userName declined your invitation!',
),
);
},
);
}