copyWith method

DatumSyncMetadata copyWith({
  1. DateTime? lastSyncTime,
  2. DateTime? lastSuccessfulSyncTime,
  3. String? dataHash,
  4. String? deviceId,
  5. Map<String, DateTime>? devices,
  6. Map<String, dynamic>? customMetadata,
  7. Map<String, DatumEntitySyncDetails>? entityCounts,
  8. SyncStatus? syncStatus,
  9. int? syncVersion,
  10. DateTime? serverTimestamp,
  11. int? conflictCount,
  12. String? errorMessage,
  13. int? retryCount,
  14. int? syncDuration,
})

Creates a copy with modified fields.

Implementation

DatumSyncMetadata copyWith({
  DateTime? lastSyncTime,
  DateTime? lastSuccessfulSyncTime,
  String? dataHash,
  String? deviceId,
  Map<String, DateTime>? devices,
  Map<String, dynamic>? customMetadata,
  Map<String, DatumEntitySyncDetails>? entityCounts,
  SyncStatus? syncStatus,
  int? syncVersion,
  DateTime? serverTimestamp,
  int? conflictCount,
  String? errorMessage,
  int? retryCount,
  int? syncDuration,
}) {
  return DatumSyncMetadata(
    userId: userId,
    lastSyncTime: lastSyncTime ?? this.lastSyncTime,
    lastSuccessfulSyncTime: lastSuccessfulSyncTime ?? this.lastSuccessfulSyncTime,
    dataHash: dataHash ?? this.dataHash,
    deviceId: deviceId ?? this.deviceId,
    devices: devices ?? this.devices,
    customMetadata: customMetadata ?? this.customMetadata,
    entityCounts: entityCounts ?? this.entityCounts,
    syncStatus: syncStatus ?? this.syncStatus,
    syncVersion: syncVersion ?? this.syncVersion,
    serverTimestamp: serverTimestamp ?? this.serverTimestamp,
    conflictCount: conflictCount ?? this.conflictCount,
    errorMessage: errorMessage ?? this.errorMessage,
    retryCount: retryCount ?? this.retryCount,
    syncDuration: syncDuration ?? this.syncDuration,
  );
}