FileSyncStateStore class
Dart VM / server file-backed SyncStateStore that persists the state to a JSON file. The file is created lazily on the first write.
Format:
{
"clientId": "client-",
"watermark": 42
}
- Implemented types
Constructors
- FileSyncStateStore(String path)
-
Creates a file-backed SyncStateStore. The
pathis the full path to the JSON file (usepath_provider.getApplicationDocumentsDirectoryon Flutter, or just a path like~/.myapp/sync_state.jsonon the Dart VM).
Properties
Methods
-
clearAsync(
) → Future< void> -
Clears all state (for tests or for the user
to reset their identity).
override
-
getClientIdAsync(
) → Future< String?> -
Returns the persisted clientId, or
nullif this is a first run.override -
getWatermarkAsync(
) → Future< int> -
Returns the persisted watermark, or
0if none.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setClientIdAsync(
String clientId) → Future< void> -
Persists
clientIdfor future reads.override -
setWatermarkAsync(
int watermark) → Future< void> -
Persists
watermarkfor future reads.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited