downloadOriginalImage method Null safety

Future<Map> downloadOriginalImage(
  1. {required dynamic target,
  2. required String? messageId}
)

下载原图 target 聊天对象, JMSingle | JMGroup | JMChatRoom messageId 本地数据库中的消息 id,非 serverMessageId

Implementation

Future<Map> downloadOriginalImage({
  required dynamic target,
  required String? messageId,
}) async {
  Map param = target.toJson();
  param['messageId'] = messageId;
  Map resJson = await _channel.invokeMethod('downloadOriginalImage',
      param..removeWhere((key, value) => value == null));

  return {'messageId': resJson['messageId'], 'filePath': resJson['filePath']};
}