retractMessage method Null safety

Future<void> retractMessage(
  1. {required dynamic target,
  2. required String? serverMessageId}
)

消息撤回 target 聊天对象, JMSingle | JMGroup serverMessageId 消息服务器 id

Implementation

Future<void> retractMessage({
  required dynamic target,

  /// (JMSingle | JMGroup )
  required String? serverMessageId,
}) async {
  Map param = target.toJson();

  param..addAll({'messageId': serverMessageId});

  print("retractMessage: ${param.toString()}");

  await _channel.invokeMethod(
      'retractMessage', param..removeWhere((key, value) => value == null));

  return;
}