deleteContact method Null safety
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 {@link EMError}.
Implementation
Future<void> deleteContact(
String username, [
bool keepConversation = false,
]) async {
Map req = {'username': username, 'keepConversation': keepConversation};
Map result = await _channel.invokeMethod(ChatMethodKeys.deleteContact, req);
try {
EMError.hasErrorFromResult(result);
} on EMError catch (e) {
throw e;
}
}