copyWith method
Creates a copy of this object with the given fields replaced with the new values.
Implementation
CloudSyncable copyWith({
String? id,
DateTime? createdAt,
DateTime? updatedAt,
DateTime? localTimeSyncedAt,
DateTime? serverTimeSyncedAt,
DateTime? deletedAt,
String? localFilePath,
String? remoteFilePath,
DateTime? fileSyncedAt,
String? timeOffset,
}) {
return CloudSyncable(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
localTimeSyncedAt: localTimeSyncedAt ?? this.localTimeSyncedAt,
serverTimeSyncedAt: serverTimeSyncedAt ?? this.serverTimeSyncedAt,
deletedAt: deletedAt ?? this.deletedAt,
localFilePath: localFilePath ?? this.localFilePath,
remoteFilePath: remoteFilePath ?? this.remoteFilePath,
fileSyncedAt: fileSyncedAt ?? this.fileSyncedAt,
timeOffset: timeOffset ??
this.timeOffset, // Only update if a new value is provided
);
}