sendMessageTransCommand method Null safety

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

会话间透传命令,只支持 single、group,不支持 chatRoom

Implementation

Future<void> sendMessageTransCommand({
  required String? message,
  required dynamic target, //(JMSingle | JMGroup)
}) async {
  if (target is JMChatRoom) {
    print("does not support chatroom message trans.");
    return;
  }

  Map param = target.toJson();
  param["message"] = message;
  param.removeWhere((key, value) => value == null);

  await _channel.invokeMethod('sendMessageTransCommand', param);
}