LocalRepository<T extends CloudSyncable> class abstract

An interface for interacting with a local data source for CloudSyncable entities.

Implementers

Constructors

LocalRepository.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addOrUpdate(List<T> items, {bool fromCloud = false}) Future<void>
Adds or updates the given items in the local repository.
clearAll() Future<void>
Clears all CloudSyncable entities of type T from the local repository.
create(T item) Future<T>
Creates a new item in the local repository.
delete(String id) Future<void>
Deletes the item with the given id from the local repository.
getAll({dynamic filter}) Future<List<T>>
Retrieves all items from the local repository, optionally filtered by filter.
getById(String id) Future<T?>
Retrieves the item with the given id from the local repository.
getLastSyncServerTime() Future<DateTime?>
Retrieves the server timestamp of the last successful sync.
getUnsyncedItems({int? limit}) Future<List<T>>
Retrieves a list of unsynced items from the local repository, optionally limiting the number of items to limit.
markAllUnsynced() Future<void>
Marks all CloudSyncable entities of type T as unsynced in the local repository.
markSynced(List<String> ids, DateTime serverTimeSyncedAt) Future<void>
Marks the items with the given ids as synced at the given serverTimeSyncedAt time.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(T item) Future<T>
Updates an existing item in the local repository.

Operators

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