deleteMessageById method Null safety

Future<void> deleteMessageById(
  1. {@required dynamic type,
  2. @required String? messageId}
)

删除本地单条消息

@param target 聊天对象, JMSingle | JMGroup @param messageId 本地数据库中的消息id,非serverMessageId

Implementation

Future<void> deleteMessageById({
  @required dynamic type,

  /// (JMSingle | JMGroup | JMChatRoom)
  @required String? messageId,
}) async {
  Map param = type.toJson();

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

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

  return;
}