getMessageHaveReadStatus method Null safety

Future<bool> getMessageHaveReadStatus(
  1. {required dynamic target,
  2. required String? msgId}
)

获取消息已读状态 target 消息所处的会话对象,user or group msgId 消息本地 id,即:message.id

Implementation

Future<bool> getMessageHaveReadStatus({
  required dynamic target,

  /// (JMSingle | JMGroup)
  required String? msgId,
}) async {
  print(flutterLog + "getMessageHaveReadStatus" + " msgid = $msgId");

  if (msgId == null || msgId.length == 0 || target == null) {
    return false;
  }

  Map param = target.toJson();
  param["id"] = msgId;
  bool isSuccess = await _channel.invokeMethod('getMessageHaveReadStatus',
      param..removeWhere((key, value) => value == null));

  return isSuccess;
}