SmartDownloader class

Constructors

SmartDownloader()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

debugGroupFanOutIsLive bool
Whether the group-scoped fan-out is currently live.
no setter
downloadPriority int
Scheduling priority for model downloads — and it must differ per platform.
no setter

Static Methods

clearConfiguration() → void
Clears injected hub configuration (e.g. registry reset / dispose).
configureDownloadUpdatesStream(Stream<TaskUpdate>? stream) → void
Registers a shared download-updates stream for all SmartDownloader paths (new downloads and attach-to-existing).
debugResolveUpdatesStream() Stream<TaskUpdate>
download({required String url, required String targetPath, String? token, int maxRetries = 10, CancelToken? cancelToken}) Future<void>
Downloads a file with smart retry logic and HTTP-aware error handling
downloadWithProgress({required String url, required String targetPath, String? token, int maxRetries = 10, CancelToken? cancelToken, bool? foreground}) Stream<int>
Downloads a file with smart retry logic and HTTP-aware error handling
isHuggingFaceUrl(String url) bool
Checks if a URL is from HuggingFace CDN
resetDownloadUpdatesStreamConfig() → void

Constants

downloadGroup → const String
The background_downloader task group ALL model downloads run under. Single source of truth — cleanup / resume code that queries or resets tasks must use this exact group, or it operates on an empty set and silently no-ops (this is what caused the #383 leak amplifier: three call sites used the stale literal 'flutter_gemma_downloads').