UniversalDownloader class

Universal downloader that works on all Flutter platforms

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

platformName String
Gets the platform name
no setter
supportsDirectorySelection bool
Checks if the current platform supports directory selection
no setter
supportsProgressTracking bool
Checks if the current platform supports progress tracking
no setter

Static Methods

downloadData({required Uint8List data, required String filename, bool saveToDocuments = false}) Future<void>
Downloads a file from binary data (Uint8List) and saves it with the given filename. Works on all platforms (web, mobile, desktop).
downloadFile({required String url, required String fileName, ProgressCallback? onProgress, CompleteCallback? onComplete, ErrorCallback? onError, bool saveToDocuments = false, bool allowSelfSignedCertificate = false}) Future<DownloadResult>
Downloads a file from the given URL and saves it with the specified filename
downloadFromUrlStream({required String url, required String filename, ProgressCallback? onProgress, CompleteCallback? onComplete, ErrorCallback? onError, bool allowSelfSignedCertificate = false}) Future<DownloadResult>
Downloads a file from URL using stream method with progress tracking. Works on all platforms and provides better memory efficiency.
downloadStream({required Stream<int> stream, required String filename, bool saveToDocuments = false}) Future<void>
Downloads a file from a stream and saves it to the given filename. Works on all platforms (web, mobile, desktop).
downloadUrl({required String url, String? filename}) Future<void>
Downloads a file directly from a URL (web only - uses browser's native download). On native platforms, use downloadFromUrlStream() method instead.
getDownloadDirectoryPath({bool saveToDocuments = false}) Future<String>
Gets the current download directory path that will be used for downloads