DatumSyncResult<T extends DatumEntityBase>.fromMap constructor
Creates a DatumSyncResult from a map.
Since pendingOperations and error are not stored, they are initialized
to their default empty/null values.
Implementation
factory DatumSyncResult.fromMap(Map<String, dynamic> map) {
return DatumSyncResult<T>(
userId: map['userId'] as String,
duration: Duration(milliseconds: map['duration'] as int),
syncedCount: map['syncedCount'] as int,
failedCount: map['failedCount'] as int,
conflictsResolved: map['conflictsResolved'] as int,
pendingOperations: const [], // Not persisted
totalBytesPushed: map['totalBytesPushed'] as int? ?? 0,
totalBytesPulled: map['totalBytesPulled'] as int? ?? 0,
bytesPushedInCycle: map['bytesPushedInCycle'] as int? ?? 0,
bytesPulledInCycle: map['bytesPulledInCycle'] as int? ?? 0,
wasSkipped: map['wasSkipped'] as bool,
wasCancelled: map['wasCancelled'] as bool,
error: null, // Not persisted
skipReason: map['skipReason'] as String?,
);
}