simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+2 -9
View File
@@ -35,11 +35,7 @@ class DownloadFailed extends DownloadStatus {
/// the same job. Kept engine-agnostic on purpose — the native
/// `background_downloader` task lives entirely inside [DownloadManager].
class DownloadJob {
DownloadJob({
required this.remotePath,
required this.name,
this.remoteFile,
});
DownloadJob({required this.remotePath, required this.name, this.remoteFile});
final String remotePath;
final String name;
@@ -59,10 +55,7 @@ class DownloadJob {
const DownloadInProgress(0),
);
bool get isFinished =>
status.value is DownloadDone ||
status.value is DownloadFailed ||
status.value is DownloadCancelled;
bool get isFinished => status.value is! DownloadInProgress;
bool get isDone => status.value is DownloadDone;
bool get isFailed => status.value is DownloadFailed;