SyncMetadata class
Metadata record tracking the sync state of a single entity instance.
Stored in a SyncMetadataStore (separate Hive box), keyed by entity
identifier (entity.id if present, else entity.hashCode). This keeps
the domain entity pure — no sync infrastructure fields pollute it.
Fields:
- status: current sync state (pending/syncing/synced/failed)
- retryCount: number of failed sync attempts (reset on success)
- lastAttemptAt: when the last sync attempt occurred
- lastError: error message from last failed attempt
- deletedAt: tombstone timestamp (non-null = record was deleted locally)
- operation: what operation needs syncing (create/update/delete)
Constructors
- SyncMetadata({required SyncStatus status, required SyncOperation operation, int retryCount = 0, DateTime? lastAttemptAt, String? lastError, DateTime? deletedAt})
-
const
Properties
- deletedAt → DateTime?
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isTombstone → bool
-
Whether this record is a tombstone (deleted locally, pending remote delete).
no setter
- lastAttemptAt → DateTime?
-
final
- lastError → String?
-
final
- operation → SyncOperation
-
final
- retryCount → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → SyncStatus
-
final
Methods
-
copyWith(
{SyncStatus? status, int? retryCount, DateTime? lastAttemptAt, String? lastError, DateTime? deletedAt, SyncOperation? operation}) → SyncMetadata -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override