simplified code across the app and consolidated duplicated helpers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user