Runs the model downloads of a manager: one download per model id, written to <directory>/<partFileName>, each
change reported on updates.
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
updates
→ Stream<
ModelDownloadUpdate> -
Every change of every download (a broadcast stream).
no setter
Methods
-
cancel(
String id) → Future< void> -
Stops the download of
idand deletes its part file; updates then reports it canceled. -
canResume(
String id) → Future< bool> -
Whether the partial data of
idcan still be resumed, also after a relaunch: a failed download whose data the downloader kept, or a part file an earlier process left (restore). -
discard(
String id) → Future< void> -
Deletes the partial data of
id, also what an earlier process left. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
String id) → Future< void> -
Pauses the download of
id, keeping what it received. -
restore(
{Iterable< DownloadTarget> targets = const []}) → Future<void> -
Reattaches to downloads that ran while the app was suspended or closed, and reports their state.
targetsname where the manager's models would be written: a downloader that keeps no records of its own (the foregroundHttpModelDownloader) reports a part file an earlier process left there as a paused download, which it can then resume or discard; one that keeps its records ignores them. -
resume(
String id) → Future< void> - Resumes a paused download, or a failed one whose partial data canResume reports, with the network rule it was started with; starts it again when it cannot resume. A resume that fails later on, because the kept data turned out unusable, fails with DownloadErrorCode.cannotResume.
-
start(
ModelEntry entry, {required String directory, required String partFileName, required bool wifiOnly}) → Future< void> -
Starts downloading
entryinto the absolute folderdirectoryaspartFileName, from the first byte.wifiOnlyasks for Wi-Fi (a downloader that cannot tell networks apart ignores it). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited