getMessageReceiptDetails method Null safety

void getMessageReceiptDetails(
  1. {@required dynamic target,
  2. @required String? msgId,
  3. @required JMCallback? callback}
)

Implementation

void getMessageReceiptDetails({
  @required dynamic target,

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

  if (callback == null) {
    return;
  }

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

  Map param = target.toJson();
  param["id"] = msgId;

  Map resultMap = await _channel.invokeMethod('getMessageReceiptDetails',
      param..removeWhere((key, value) => value == null));
  if (resultMap != null) {
    List receiptJosnList = resultMap["receiptList"];
    List unreceiptJosnList = resultMap["unreceiptList"];

    List<JMUserInfo> receiptUserList =
        receiptJosnList.map((json) => JMUserInfo.fromJson(json)).toList();
    List<JMUserInfo> unreceiptUserList =
        unreceiptJosnList.map((json) => JMUserInfo.fromJson(json)).toList();
    callback(receiptUserList, unreceiptUserList);
  } else {
    callback(null, null);
  }
}