getQuery<DataType, ErrorType> method
Finds the Query with the given key and returns it
exact can be used to match the key exactly or by prefix
Implementation
Query<DataType, ErrorType>? getQuery<DataType, ErrorType>(
String key, {
bool exact = true,
}) {
return cache.queries
.firstWhereOrNull(
(query) => exact ? query.key == key : query.key.startsWith(key),
)
?.cast<DataType, ErrorType>();
}