deleteMessage method Null safety

Future<void> deleteMessage(
  1. String messageId
)

Deletes a message in the local database.

Note After this method is called, the message is only deleted both from the memory and the local database.

Param messageId The ID of message to be deleted.

Throws A description of the exception. See {@link EMError}.

Implementation

Future<void> deleteMessage(String messageId) async {
  Map req = this._toJson();
  req['msg_id'] = messageId;
  Map result = await _emConversationChannel.invokeMethod(
      ChatMethodKeys.removeMessage, req);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}