mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
feat: Add download speed to progress bar
This commit is contained in:
parent
d22d340181
commit
5a5a4e4703
7 changed files with 95 additions and 68 deletions
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue