ChunkMetadata constructor

ChunkMetadata({
  1. required String filename,
  2. required int chunkIndex,
  3. required int totalChunks,
  4. required int diskIndex,
  5. required int originalSize,
  6. required String checksum,
  7. int? totalFileSize,
  8. String? parityChecksum,
  9. bool isParityChunk = false,
  10. bool compressed = false,
  11. bool encrypted = false,
  12. String raidType = 'raid5',
  13. DateTime? createdAt,
})

Creates a ChunkMetadata.

createdAt defaults to DateTime.now() when omitted.

Implementation

ChunkMetadata({
  required this.filename,
  required this.chunkIndex,
  required this.totalChunks,
  required this.diskIndex,
  required this.originalSize,
  required this.checksum,
  this.totalFileSize,
  this.parityChecksum,
  this.isParityChunk = false,
  this.compressed = false,
  this.encrypted = false,
  this.raidType = 'raid5',
  DateTime? createdAt,
}) : createdAt = createdAt ?? DateTime.now();