updateMessage method Null safety

Future<void> updateMessage(
  1. EMMessage message
)

Updates a message in the local database.

The latestMessage of the conversation and other properties will be updated accordingly. The message ID of the message, however, remains the same.

Param message The message to be updated.

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

Implementation

Future<void> updateMessage(EMMessage message) async {
  Map req = this._toJson();
  req['msg'] = message.toJson();
  Map result = await _emConversationChannel.invokeMethod(
      ChatMethodKeys.updateConversationMessage, req);
  EMError.hasErrorFromResult(result);
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}