removeDocumentListener method

void removeDocumentListener(
  1. ModelAdapterDocumentQuery? query, {
  2. String? prefix,
})

Pass query to remove the document corresponding to query from the monitored list.

prefix can be specified to prefix the path.

queryを渡してqueryに対応するドキュメントを監視対象から外します。

prefixを指定するとパスにプレフィックスを付与可能です。

Implementation

void removeDocumentListener(
  ModelAdapterDocumentQuery? query, {
  String? prefix,
}) {
  if (query == null) {
    return;
  }
  final trimPath = _path(query.query.path, prefix);
  if (_documentListeners.containsKey(trimPath)) {
    _documentListeners[trimPath]!.remove(query.origin);
  }
}