BlobUploadProgress constructor

BlobUploadProgress({
  1. required String currentServer,
  2. required int sentBytes,
  3. required int totalBytes,
  4. required List<BlobUploadResult> completedUploads,
  5. UploadPhase phase = UploadPhase.uploading,
  6. double? progressPhase,
  7. int? mirrorsTotal,
  8. int? mirrorsCompleted,
  9. bool isComplete = false,
})

Implementation

BlobUploadProgress({
  required this.currentServer,
  required this.sentBytes,
  required this.totalBytes,
  required this.completedUploads,
  this.phase = UploadPhase.uploading,
  double? progressPhase,
  int? mirrorsTotal,
  int? mirrorsCompleted,
  this.isComplete = false,
})  : progressPhase =
          ((progressPhase ?? (totalBytes > 0 ? sentBytes / totalBytes : 0))
                  .clamp(0.0, 1.0))
              .toDouble(),
      percentagePhase =
          ((progressPhase ?? (totalBytes > 0 ? sentBytes / totalBytes : 0))
                      .clamp(0.0, 1.0))
                  .toDouble() *
              100,
      mirrorsTotal = mirrorsTotal ?? 0,
      mirrorsCompleted = mirrorsCompleted ?? 0;