getInfiniteQuery<DataType, ErrorType, PageType> method

InfiniteQuery<DataType, ErrorType, PageType>? getInfiniteQuery<DataType, ErrorType, PageType>(
  1. String key, {
  2. bool exact = true,
})

Finds the InfiniteQuery with the given key

exact can be used to match the key exactly or by prefix

Implementation

InfiniteQuery<DataType, ErrorType, PageType>?
    getInfiniteQuery<DataType, ErrorType, PageType>(
  String key, {
  bool exact = true,
}) {
  return cache.infiniteQueries
      .firstWhereOrNull(
          (query) => exact ? query.key == key : query.key.startsWith(key))
      ?.cast<DataType, ErrorType, PageType>();
}