downloadThumbnail method Null safety

Future<void> downloadThumbnail(
  1. EMMessage message
)

Downloads the thumbnail if the message has not been downloaded before or if the download fails.

Param message The message object.

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

Implementation

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