getMessageUnreceiptCount method Null safety

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

Implementation

Future<int> getMessageUnreceiptCount({
  required dynamic target,

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

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

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

  int count = await _channel.invokeMethod('getMessageUnreceiptCount',
      param..removeWhere((key, value) => value == null));
  return count;
}