removeContact method

dynamic removeContact(
  1. String atSign
)

removes atSign to allContacts

Implementation

removeContact(String atSign) {
  try {
    allContacts.removeWhere((element) {
      if (element!.contact == null) {
        return false;
      }
      return ContactService().compareAtSign(element.contact!.atSign!, atSign);
    });

    _allContactsStreamController.add(allContacts);
  } catch (e) {
    _allContactsStreamController.add([]);
  }
}