deleteContact method

Future<void> deleteContact(
  1. String username,
  2. {bool keepConversation = false}

Deletes a contact and all the related conversations.

Param username The contact to be deleted.

Param keepConversation Whether to retain conversations of the deleted contact.

  • true: Yes.
  • false: (default) No.

Throws A description of the exception. See ChatError.


Future<void> deleteContact(
  String username, {
  bool keepConversation = false,
}) async {
  Map req = {'username': username, 'keepConversation': keepConversation};
  Map result = await _channel.invokeMethod(ChatMethodKeys.deleteContact, req);
  try {
  } on ChatError catch (e) {
    throw e;