LocalStore class

An in-memory store for SyncRecord instances.

Provides CRUD operations, filtering by status, and aggregate statistics.

Constructors

LocalStore()

Properties

count int
The total number of records in the store.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

all() List<SyncRecord>
Return all records in the store.
clear() → void
Remove all records from the store.
get(String id) SyncRecord?
Retrieve a record by id, or null if not found.
markModified(String id) → void
Mark the record with id as SyncStatus.modified.
markSynced(String id) → void
Mark the record with id as SyncStatus.synced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pending() List<SyncRecord>
Return all records with SyncStatus.pending or SyncStatus.modified.
put(SyncRecord record) → void
Store a record, replacing any existing record with the same id.
putAll(List<SyncRecord> records) → void
Store multiple records at once.
query({required bool where(SyncRecord)}) List<SyncRecord>
Query records using a where predicate.
queryByTag(String tag) List<SyncRecord>
Return all records that contain the given tag.
remove(String id) bool
Remove the record with the given id.
statistics() StoreStatistics
Return aggregate statistics about the store contents.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited