resource_repository library

Classes

CacheEntry<V>
The unified model used by CacheStorage.
CacheStorage<K, V>
Extend this class to implement your own CacheStorage.
MemoryCacheStorage<K, V>
A simple implementation of CacheStorage. Used by default. It just keeps the data in memory.
Resource<T>
Resource data class.
ResourceFetchArguments
Optional arguments passes into StreamResource._fetch.
StreamRepository<K, V>
Repository for resource management.
StreamResource<K, V>
Resource used for managing the data. Allows load, invalidate, clear local data or use with delegated _fetch callback.

Typedefs

CacheDurationResolver<K, V> = Duration Function(K key, V value)
Should return the duration of the cache.
FetchData<K, V> = Future<V> Function(K key, ResourceFetchArguments? arguments)
Fetch data from external service callback. Typically REST API call.