matches method

bool matches(
  1. QueryKey filter, {
  2. bool exact = false,
})

Whether filter matches this key.

With exact: false (the default) the filter is a prefix, and any map inside it needs only the entries it names (TanStack Query's partialMatchKey). QueryKey(['tasks']) matches QueryKey(['tasks', 3]), and QueryKey(['tasks', {'project': 'website'}]) matches a key whose map also carries a 'status' entry.

Implementation

bool matches(QueryKey filter, {bool exact = false}) =>
    exact ? this == filter : _partialMatch(parts, filter.parts);