SyncClient class Null safety

Sync client is used to connect to an ObjectBox sync server.


SyncClient(Store _store, String serverUri, SyncCredentials creds)
Creates a sync client associated with the given store and options. This does not initiate any connection attempts yet: call start() to do so.


changeEvents Stream<List<SyncChange>>
Get a broadcast stream of incoming synced data changes.
completionEvents Stream<void>
Get a broadcast stream of sync completion events - when synchronization of incoming changes has completed.
connectionEvents Stream<SyncConnectionEvent>
Get a broadcast stream of connection state changes (connect/disconnect).
hashCode int
The hash code for this object.
read-only, inherited
loginEvents Stream<SyncLoginEvent>
Get a broadcast stream of login events (success/failure).
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


cancelUpdates() bool
Cancel updates from the server so that it will stop sending updates. See also requestUpdates().
close() → void
Closes and cleans up all resources used by this sync client. It can no longer be used afterwards, make a new sync client instead. Does nothing if this sync client has already been closed.
isClosed() bool
Returns if this sync client is closed and can no longer be used.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
outgoingMessageCount({int limit = 0}) int
Count the number of messages in the outgoing queue, i.e. those waiting to be sent to the server.
requestUpdates({required bool subscribeForFuturePushes}) bool
Request updates since we last synchronized our database.
setCredentials(SyncCredentials creds) → void
Configure authentication credentials, depending on your server config.
setRequestUpdatesMode(SyncRequestUpdatesMode mode) → void
Configures how sync updates are received from the server. If automatic updates are turned off, they will need to be requested manually.
start() → void
Once the sync client is configured, you can start it to initiate synchronization.
state() SyncState
Gets the current sync client state.
stop() → void
Stops this sync client. Does nothing if it is already stopped.
toString() String
A string representation of this object.


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