RemoteStore class abstract interface

The contract the engine needs from your backend.

Implement it over Firestore, Supabase, REST, GraphQL, an S3 bucket, or use InMemoryRemoteStore to develop before the backend exists.

Two requirements matter more than they look:

  1. PullResult.serverTime must be the server's clock, not the client's. The engine stores it as the next pull cursor. If each device supplied its own time, a device with a slow clock would never see other devices' writes.
  2. Push must be idempotent per record id. Retries are normal, so a second push of the same payload must not create a duplicate.
Implementers

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pull({DateTime? since, int limit = 200, String? cursor}) → Future<PullResult>
Downloads changes newer than since, or everything when null.
purgeTombstones(DateTime olderThan) → Future<int>
Optionally removes server-side tombstones older than olderThan. Returning 0 is a perfectly good implementation.
push(List<SyncDocument> documents) → Future<PushResult>
Uploads documents.
toString() → String
A string representation of this object.
inherited

Operators

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