LocalMemorySource<T> class
On-device, in-memory store which caches previously loaded data for instantaneous retrieval. Does not persist any data across sessions.
- Inheritance
-
- Object
- DataContract<
T> - Source<
T> - LocalSource<
T> - LocalMemorySource
Constructors
-
LocalMemorySource({required Bindings<
T> ? bindings, DateTime now()?, Duration? ttl}) - On-device, in-memory store which caches previously loaded data for instantaneous retrieval. Does not persist any data across sessions.
Properties
-
bindings
↔ Bindings<
T> -
All meta information about
Tnecessary to plug arbitrary data types into a Repository.getter/setter pairinherited - hasBindings → bool
-
Proxy getter for whether bindings has been initialized, either by being
passed in via this constructor or by being set by the SourceList.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceType ↔ SourceType
-
Indicator for whether this Source loads data from a store on-device, or
off-device.
getter/setter pairinherited
- ttl → Duration?
-
Duration after which the data should be considered stale. Stale data will
not be returned, and will be deleted when requested. There is no other
periodic process to remove stale data - if it is never requested again,
it will remain in storage indefinitely.
finalinherited
Methods
-
clear(
) → Future< void> -
Removes all data from the local persistence.
inherited
-
clearForRequest(
RequestDetails details) → Future< void> -
Clears this request from the request cache.
inherited
-
delete(
String id, RequestDetails details) → Future< DeleteResult< T> > -
Clears an item with the given
idif one exists.inherited -
deleteIds(
Set< String> ids) → Future<void> -
Removes these Ids from storage anywhere they may exist, which is why no
RequestDetails are needed.
inherited
-
getById(
String id, RequestDetails details) → Future< ReadResult< T> > -
Loads the instance of
Twhose primary key isid.inherited -
getByIds(
Set< String> ids, RequestDetails details) → Future<ReadListResult< T> > -
Loads all instances of
Twhose primary key is in the setids.inherited -
getItems(
RequestDetails details) → Future< ReadListResult< T> > -
Loads all instances of
Tthat satisfy any filtes or pagination ondetails.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setItem(
T item, RequestDetails details) → Future< WriteResult< T> > -
Persists
item.inherited -
setItems(
Iterable< T> items, RequestDetails details) → Future<WriteListResult< T> > -
Persists all
items.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited