SmartDownloader class

Smart downloader with HTTP-aware retry logic

Features:

  • HTTP-aware retry: Auth errors (401/403/404) fail after 1 attempt
  • Transient errors (network/5xx) retry up to maxRetries times
  • Exponential backoff strategy
  • Completer-based waiting for completion
  • Progress tracking with Updates.statusAndProgress
  • Works with ANY URL (HuggingFace, Google Drive, custom servers, etc.)
  • Supports multiple concurrent downloads

Constructors

SmartDownloader.new()

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 Methods

downloadWithProgress({required String url, required String targetPath, String? token, int maxRetries = 10}) 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