deleteContacts method

Future<void> deleteContacts()

Deletes the selectedContacts from the authenticated MyUser's address book.

Implementation

Future<void> deleteContacts() async {
  selecting.value = false;
  router.navigation.value = !selecting.value;

  try {
    final Iterable<Future> futures = selectedContacts.map(
      (e) => _contactService.deleteContact(e),
    );
    await Future.wait(futures);
  } catch (e) {
    MessagePopup.error(e);
    rethrow;
  } finally {
    selectedContacts.clear();
  }
}