sources library

Classes

ApiSource<T>
Subtype of Source which knows how to make network requests to load data.
Bindings<T>
Holds meta-information for a subclass of data class, making it fully pluggable within any subtype of DataContract.
ComboFilter
Specialized filter meant to combine multiple children filters.
CreationBindings<T>
Bindings for an object that the client can save locally without requiring the use of the server to generate an Id.
DeleteResult<T>
///////??/////// DELETE RESULTS /////////??/////
ExpiringCache<T>
Filter
Interface for filters on requests for data which will be applied inside Source objects.
InMemoryPersistence<T>
In-memory storage for a LocalSource. This is a glorified Map.
LocalMemorySource<T>
On-device, in-memory store which caches previously loaded data for instantaneous retrieval. Does not persist any data across sessions.
LocalSource<T>
Flavor of Source which is entirely on-device.
MatchedSource<T>
Indicates whether a given Source was queried within a request, which is used when during the write-through cache phase.
Pagination
Page index and size information for a read request, or a write request if we are caching loaded data to a local Source.
ProxySource<T>
ReadListResult<T>
ReadResult<T>
////////////// READ RESULTS //////////////
Repository<T>
Data abstraction most likely to be exposed to other layers of the application. Subclasses of this are where domain-specific logic should live.
RequestDetails
Container for meta-information a Source will use to return the desired data.
Source<T>
{@template Source} Parent type of all entries in a SourceList. Each Source subtype should know how to load data from a particular place. The field sourceType indicates whether that place is immediately accessible (and thus is a cache) or is remotely accessible and thus is the source of truth. {@endtemplate }
SourceCache<T>
SourceList<T>
Data component which iteratively asks individual sources for an object.
WriteListResult<T>
WriteResult<T>

Enums

BooleanLogic
Flavors of combination logic for multiple filters.
FailureReason
/////////////// WRITE RESULTS /////////////// Explanations for why a write request may have failed.
RequestType
Classifier for a data request which tells a subtype of DataContract where to look for the desired data.
SourceType
Classifier for a given Source instance's primary data location.

Extensions

DeleteResultPatterns on DeleteResult<T>
Adds pattern-matching-related methods to DeleteResult.
ReadListResultPatterns on ReadListResult<T>
Adds pattern-matching-related methods to ReadListResult.
ReadResultPatterns on ReadResult<T>
Adds pattern-matching-related methods to ReadResult.
WriteListResultPatterns on WriteListResult<T>
Adds pattern-matching-related methods to WriteListResult.
WriteResultPatterns on WriteResult<T>
Adds pattern-matching-related methods to WriteResult.

Constants

isFailure → const Matcher
Testing matcher for whether this request was a failure.
isSuccess → const Matcher
Testing matcher for whether this was a success.

Functions

utc() DateTime
Returns the current time in UTC. Needed for const constructor support.

Typedefs

CacheKey = String
The product of RequestDetails.cacheKey.
DeleteItem<T> = Future<DeleteResult<T>> Function(String, RequestDetails)
Logic to activate deleteItem.
GetById<T> = Future<T> Function(String, RequestDetails)
Logic to activate getById.
GetByIds<T> = Future<List<T>> Function(Set<String>, RequestDetails)
Logic to activate getByIds.
GetItems<T> = Future<List<T>> Function(RequestDetails)
Logic to activate getItems.
IdBuilder<T> = String Function(T)
Function which can assign a new Id to an unsaved item.
IdReader<T> = String? Function(T obj)
Function which extracts the primary key from an object.
SetItem<T> = Future<T?> Function(T, RequestDetails)
Logic to activate setItem.
SetItems<T> = Future<List<T>?> Function(Iterable<T>, RequestDetails)
Logic to activate setItems.