addNewContactAndGroupMembers method

dynamic addNewContactAndGroupMembers(
  1. List<GroupContactsModel?> selectedList
)

Implementation

addNewContactAndGroupMembers(List<GroupContactsModel?> selectedList) {
  EventService().selectedContacts = [];
  EventService().selectedContactsAtSigns = [];
  EventService().eventNotificationModel!.group!.members = {};

  selectedList.forEach((element) {
    if (element!.contact != null) {
      var newContact = getGroupMemberContact(element.contact!);
      // EventService().eventNotificationModel!.group!.members!.add(newContact);
      // EventService().selectedContacts!.add(newContact);
      // selectedContactsAtSigns.add(newContact.atSign);
      addContactToList(newContact);
    } else if (element.group != null) {
      element.group!.members!.forEach((groupMember) {
        var newContact = getGroupMemberContact(groupMember);
        // EventService()
        //     .eventNotificationModel!
        //     .group!
        //     .members!
        //     .add(newContact);
        // EventService().selectedContacts!.add(newContact);
        // selectedContactsAtSigns.add(newContact.atSign);
        addContactToList(newContact);
      });
    }
  });
}