getAtsignsFromEvent method

List<String> getAtsignsFromEvent(
  1. EventNotificationModel _event
)

return all atsigns in an event except the logged in user.

Implementation

List<String> getAtsignsFromEvent(EventNotificationModel _event) {
  List<String> _allAtsignsInEvent = [];

  if (!compareAtSign(_event.atsignCreator!,
      AtClientManager.getInstance().atClient.getCurrentAtSign()!)) {
    _allAtsignsInEvent.add(_event.atsignCreator!);
  }

  if (_event.group!.members!.isNotEmpty) {
    Set<AtContact>? groupMembers = _event.group!.members!;

    // ignore: avoid_function_literals_in_foreach_calls
    groupMembers.forEach((member) {
      if (!compareAtSign(member.atSign!,
          AtClientManager.getInstance().atClient.getCurrentAtSign()!)) {
        _allAtsignsInEvent.add(member.atSign!);
      }
    });
  }

  return _allAtsignsInEvent;
}