downloadAttachment method Null safety

Future<void> downloadAttachment(
  1. EMMessage message
)

Downloads the attachment files from the server.

You can call the method again if the attachment download fails.

Param message The message with the attachment that is to be downloaded.

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

Implementation

Future<void> downloadAttachment(EMMessage message) async {
  Map result = await _channel.invokeMethod(
      ChatMethodKeys.downloadAttachment, {"message": message.toJson()});
  try {
    EMError.hasErrorFromResult(result);
  } on EMError catch (e) {
    throw e;
  }
}