Session class Sync

An object encapsulating a synchronization session. Sessions represent the communication between the client (and a local Realm file on disk), and the server. Sessions are always created by the SDK and vended out through various APIs. The lifespans of sessions associated with Realms are managed automatically.

Implemented types

Properties

connectionState ConnectionState
The session’s current connection state. This is the physical state of the connection and is different from the session's logical state, which is returned by state.
no setter
connectionStateChanges Stream<ConnectionStateChange>
Gets a Stream of ConnectionState that can be used to be notified whenever the connection state changes.
no setter
hashCode int
The hash code for this object.
no setterinherited
realmPath String
The on-disk path of the file backing the Realm this Session represents
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state SessionState
The session’s current state. This is different from connectionState since a session may be active, even if the connection is disconnected (e.g. due to the device being offline).
no setter
user User
The User that owns the Realm this Session is synchronizing.
no setter

Methods

getProgressStream(ProgressDirection direction, ProgressMode mode) Stream<SyncProgress>
Gets a Stream of SyncProgress that can be used to track upload or download progress.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → void
Pauses any synchronization with the server until the Realm is re-opened again after fully closing it or resume is called.
resume() → void
Attempts to resume the session and enable synchronization with the server. All sessions are active by default and calling this method is only necessary if pause was called previously.
toString() String
A string representation of this object.
inherited
waitForDownload([CancellationToken? cancellationToken]) Future<void>
Waits for the Session to finish all pending downloads. An optional cancellationToken can be used to cancel the wait operation.
waitForUpload([CancellationToken? cancellationToken]) Future<void>
Waits for the Session to finish all pending uploads. An optional cancellationToken can be used to cancel the wait operation.

Operators

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