Init repo

This commit is contained in:
PartyDonut 2024-09-15 14:12:28 +02:00
commit 764b6034e3
566 changed files with 212335 additions and 0 deletions

View file

@ -0,0 +1,41 @@
import 'package:background_downloader/background_downloader.dart' as dl;
class DownloadStream {
final String id;
final dl.DownloadTask? task;
final double progress;
final dl.TaskStatus status;
DownloadStream({
required this.id,
this.task,
required this.progress,
required this.status,
});
DownloadStream.empty()
: id = '',
task = null,
progress = -1,
status = dl.TaskStatus.notFound;
bool get hasDownload => progress != -1.0 && status != dl.TaskStatus.notFound && status != dl.TaskStatus.complete;
DownloadStream copyWith({
String? id,
dl.DownloadTask? task,
double? progress,
dl.TaskStatus? status,
}) {
return DownloadStream(
id: id ?? this.id,
task: task ?? this.task,
progress: progress ?? this.progress,
status: status ?? this.status,
);
}
@override
String toString() {
return 'DownloadStream(id: $id, task: $task, progress: $progress, status: $status)';
}
}