DriftSynchronizer<TAppDatabase extends SynchronizerDb> class abstract

Constructors

DriftSynchronizer({required TAppDatabase appDatabase, required Set<SyncTypeHandler> typeHandlers})

Properties

appDatabase → TAppDatabase
final
hashCode int
The hash code for this object.
no setterinherited
onCancelRequested Future<void> Function()?
no setter
onStarted Future<void> Function()?
no setter
onStateChanged Future<void> Function(SyncState previous, SyncState current)?
no setter
onStopped Future<void> Function(SyncState state)?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state SyncState
no setter
typeHandlers Set<SyncTypeHandler>
final

Methods

cancel() → void
downloadServerChanges() Future<void>
tries to do a partial synchronization from the server, but falls back to full synchronization when needed
fullResync() Future<void>
Synchronizes pending local changes to the server does full synchronization from the server.
getLatestServerChangeId() Future<String?>
Gets the Id of the latest available change from the server.
getServerPendingChanges(String? lastChangeId) Future<List<ServerChange>>
Gets the pending changes from the server, starting with lastChangeId. Will return an empty stream if no changes are available, but lastChangeId still exists in the change log. Will return null if lastChangeId has expired and removed from the change log.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sync() Future<void>
Synchronizes pending local changes to the server and tries to do sync the pending changes from the server to the app. When it is not possible to do a consistent synchronization of the pending changes from the server, reverts to a full synchronization from the server.
toString() String
A string representation of this object.
inherited
uploadLocalChanges() Future<bool>
synchronizes all local changes to the server Returns a list of local changes that were discarded because of optimistic conflict

Operators

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