feat: Add download speed to progress bar

This commit is contained in:
PartyDonut 2025-08-29 19:29:47 +02:00
parent d22d340181
commit 5a5a4e4703
7 changed files with 95 additions and 68 deletions

View file

@ -4,11 +4,13 @@ class DownloadStream {
final String id;
final dl.DownloadTask? task;
final double progress;
final String downloadSpeed;
final dl.TaskStatus status;
DownloadStream({
required this.id,
this.task,
required this.progress,
this.progress = -1,
this.downloadSpeed = "",
required this.status,
});
@ -16,6 +18,7 @@ class DownloadStream {
: id = '',
task = null,
progress = -1,
downloadSpeed = "",
status = dl.TaskStatus.notFound;
bool get hasDownload => progress != -1.0 && status != dl.TaskStatus.notFound && status != dl.TaskStatus.complete;
@ -24,12 +27,14 @@ class DownloadStream {
String? id,
dl.DownloadTask? task,
double? progress,
String? downloadSpeed,
dl.TaskStatus? status,
}) {
return DownloadStream(
id: id ?? this.id,
task: task ?? this.task,
progress: progress ?? this.progress,
downloadSpeed: downloadSpeed ?? this.downloadSpeed,
status: status ?? this.status,
);
}