sendMessageReadAck method Null safety

Future<bool> sendMessageReadAck(
  1. EMMessage message
)

Sends the read receipt to the server.

This method applies to one-to-one chats only.

Warning This method only takes effect if you set {@link EMOptions#requireAck(bool)} as true.

Note To send the group message read receipt, call {@link #sendGroupMessageReadAck(String, String, String)}.

We recommend that you call {@link #sendConversationReadAck(String)} when entering a chat page, and call this method to reduce the number of method calls.

Param message The message body: {@link EMMessage}.

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

Implementation

Future<bool> sendMessageReadAck(EMMessage message) async {
  Map req = {"to": message.from, "msg_id": message.msgId};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.ackMessageRead, req);
  try {
    EMError.hasErrorFromResult(result);
    return result.boolValue(ChatMethodKeys.ackMessageRead);
  } on EMError catch (e) {
    throw e;
  }
}