updateMessage method Null safety

Future<void> updateMessage(
  1. ChatMessage message
)

Updates the local message.

The message will be updated both in the cache and local database.

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

Implementation

Future<void> updateMessage(ChatMessage message) async {
  Map req = {"message": message.toJson()};
  Map result = await ChatMethodChannel.ChatManager.invokeMethod(
      ChatMethodKeys.updateChatMessage, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}