DatumSyncResult<T extends DatumEntityInterface> class

Represents the outcome of a synchronization cycle.

Annotations
  • @immutable

Constructors

DatumSyncResult({required String userId, required Duration duration, required int syncedCount, required int failedCount, required int conflictsResolved, required List<DatumSyncOperation<T>> pendingOperations, int totalBytesPushed = 0, int totalBytesPulled = 0, int bytesPushedInCycle = 0, int bytesPulledInCycle = 0, bool wasSkipped = false, bool wasCancelled = false, Object? error, String? skipReason})
Creates a new DatumSyncResult.
const
DatumSyncResult.cancelled(String userId, int syncedCount)
Creates a result for a sync cycle that was cancelled.
const
DatumSyncResult.fromError(String userId, Object? error)
Creates a result for a sync cycle that failed with an error.
const
DatumSyncResult.fromMap(Map<String, dynamic> map)
Creates a DatumSyncResult from a map.
factory
DatumSyncResult.skipped(String userId, int pendingCount, {String? reason})
Creates a result for a sync cycle that was skipped.
factory

Properties

bytesPulledInCycle → int
The number of bytes pulled from the remote in just this sync cycle.
final
bytesPushedInCycle → int
The number of bytes pushed to the remote in just this sync cycle.
final
conflictsResolved → int
The number of conflicts that were detected and resolved.
final
duration → Duration
The total duration of the sync cycle.
final
error → Object?
The error that caused the sync to fail, if any.
final
failedCount → int
The number of operations that failed to sync.
final
hashCode → int
The hash code for this object.
no setterinherited
isSuccess → bool
Whether the sync completed successfully without any failures.
no setter
pendingOperations → List<DatumSyncOperation<T>>
A list of operations that are still pending after the sync cycle.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skipReason → String?
A reason why the sync was skipped, if applicable.
final
successPercentage → double
The success rate of the sync cycle as a percentage (0.0 to 100.0).
no setter
syncedCount → int
The number of operations that were successfully synced.
final
totalBytesPulled → int
The total cumulative number of bytes pulled from the remote for this user.
final
totalBytesPushed → int
The total cumulative number of bytes pushed to the remote for this user.
final
totalOperations → int
The total number of operations processed in this sync cycle.
no setter
userId → String
The user ID for which the sync was performed.
final
wasCancelled → bool
Whether the sync was cancelled (e.g., due to the manager being disposed).
final
wasSkipped → bool
Whether the sync was skipped (e.g., due to being offline or another sync in progress).
final

Methods

describe() → String
A human-readable, multi-line summary suitable for logging/debugging.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Converts the result to a map for serialization.
toString() → String
A string representation of this object.
override

Operators

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