shouldCache property
final
A predicate determining whether a given item should be cached.
This function is called whenever an item is added to the cache. If it returns true
, the item
is added and can later be retrieved. If it returns false, the item is not added.
The default is to add all items to the cache.
Implementation
final bool Function(T item)? shouldCache;