-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
348 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
abstract class DownloadTask<T> { | ||
const DownloadTask(); | ||
|
||
@override | ||
String toString(); | ||
} | ||
|
||
class DownloadTaskFilename extends DownloadTask { | ||
String filename; | ||
|
||
DownloadTaskFilename({ | ||
required String initialFilename, | ||
}) : filename = initialFilename; | ||
|
||
@override | ||
bool operator ==(Object other) { | ||
if (other is DownloadTaskFilename) return filename == other.filename; | ||
return false; | ||
} | ||
|
||
@override | ||
int get hashCode => filename.hashCode; | ||
|
||
@override | ||
String toString() => filename; | ||
} | ||
|
||
class DownloadTaskVideoId { | ||
final String videoId; | ||
|
||
const DownloadTaskVideoId({ | ||
required this.videoId, | ||
}); | ||
|
||
@override | ||
bool operator ==(Object other) { | ||
if (other is DownloadTaskVideoId) return videoId == other.videoId; | ||
return false; | ||
} | ||
|
||
@override | ||
int get hashCode => videoId.hashCode; | ||
|
||
@override | ||
String toString() => videoId; | ||
} | ||
|
||
class DownloadTaskGroupName { | ||
final String groupName; | ||
|
||
const DownloadTaskGroupName({ | ||
required this.groupName, | ||
}); | ||
|
||
const DownloadTaskGroupName.defaulty() : groupName = ''; | ||
|
||
@override | ||
bool operator ==(Object other) { | ||
if (other is DownloadTaskGroupName) return groupName == other.groupName; | ||
return false; | ||
} | ||
|
||
@override | ||
int get hashCode => groupName.hashCode; | ||
|
||
@override | ||
String toString() => groupName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.