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 //////////////// Outcome of an attempted delete operation. It may have succeeded, failed, or had no chance due to connectivity issues.
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.
Operation<T>
Carrier for all information required to describe a data operation.
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>
Outcome of an attempted bulk read operation. It may have succeeded, failed, or had no chance due to connectivity issues.
ReadResult<T>
////////////// READ RESULTS ////////////// Outcome of an attempted read operation. It may have succeeded, failed, or had no chance due to connectivity issues.
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.
RequestDetailsConverter
Converter for RequestDetails to be used in freezed classes.
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>
Outcome of an attempted bulk write operation. It may have succeeded, failed, or had no chance due to connectivity issues.
WriteResult<T>
/////////////// WRITE RESULTS /////////////// Outcome of an attempted write operation. It may have succeeded, failed, or had no chance due to connectivity issues.

Enums

BooleanLogic
Flavors of combination logic for multiple filters.
FailureReason
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.
OperationPatterns on Operation<T>
Adds pattern-matching-related methods to Operation.
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(DeleteOperation<T>)
Logic to activate deleteItem.
GetById<T> = Future<T> Function(ReadOperation<T>)
Logic to activate getById.
GetByIds<T> = Future<List<T>> Function(ReadByIdsOperation<T>)
Logic to activate getByIds.
GetItems<T> = Future<List<T>> Function(ReadListOperation<T>)
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(WriteOperation<T>)
Logic to activate setItem.
SetItems<T> = Future<List<T>?> Function(WriteListOperation<T>)
Logic to activate setItems.