download_assets
4.1.0, released 11 months ago by an unverified publisher
Download files (optionally unzip) and store them locally for later use.
Unverified publisher
What it does
The package downloads assets from given URLs, can uncompress them using built‑in or custom delegates, and saves them to a configurable directory. It provides callbacks for progress, completion and cancellation, and supports web, mobile and desktop platforms.
AI-written summary of version 4.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to fetch large assets (images, videos, zip bundles) at runtime rather than bundling them with the app
- You require custom decompression for formats beyond ZIP
- You want a simple API with progress reporting and optional cancellation
Skip it when
- You need a full‑featured caching or offline sync solution
- You require secure/encrypted storage of sensitive data
- You only need basic HTTP GET without file handling
Strengths
- Built‑in support for ZIP and custom uncompress delegates
- Cross‑platform including web support
- Progress, start‑unzip and cancel callbacks
Weaknesses
- Relies on dio; no built‑in retry or cache management
- Only handles file download/unzip, not higher‑level asset management
- Permissions required on mobile platforms
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
Add storage permissions for Android/iOS; initialize with downloadAssetsController.init() before use
await downloadAssetsController.init();
await downloadAssetsController.startDownload(
assetsUrls:[AssetUrl(url:'https://example.com/file.zip')],
onProgress:(p)=>print('Progress: $p'),
onDone:()=>print('Done'),
);Works with
Packages commonly used together with download_assets: ones it builds on, ones built on it, and its own family.
- archivedownload_assets depends on itEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- path_providerdownload_assets depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- shared_preferencesdownload_assets depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- diodownload_assets depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- idb_shimdownload_assets depends on itCross-platform IndexedDB implementation for Dart and Flutter.