flutter_cache_manager
3.5.0, released 2 weeks ago by baseflow.com
Generic cache manager for saving web files and cache info on device storage.
What it does
Downloads and caches web files in the device's storage directory, utilizing HTTP Cache-Control headers for efficient retrieval. It tracks cache info using sqflite on supported platforms and JSON elsewhere, and supports automatic cleanup based on age and count.
AI-written summary of version 3.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to download files or images from the web and cache them locally.
- You want automatic cache eviction based on file age and maximum item counts.
Skip it when
- You only need local key-value persistence without downloading web files.
- You require a complex relational database management system for local data.
Strengths
- Efficient handling of Cache-Control headers and ETags.
- Built-in support for image resizing via ImageCacheManager.
- Customizable cache keys, file services, and storage systems.
Weaknesses
- Creating multiple cache managers with the same key can cause conflicts.
- Stale cache cleanups depend on background processes and OS-level storage clearing.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 9
var file = await DefaultCacheManager().getSingleFile(url);Alternatives
Packages that do the same job and could replace flutter_cache_manager.
- simple_secure_storage
Secure key‑value storage for Flutter with platform‑specific backends.
77Compare - cross_cache
Cross-platform caching library for Flutter using IndexedDB and the file system.
78Compare - persistent_device_id
Provides a persistent, app‑scoped device ID for Android and iOS.
61Compare - cached_storage
Adds persistent storage to CachedQuery using Sqflite
80Compare
Works with
Packages commonly used together with flutter_cache_manager: ones it builds on, ones built on it, and its own family.
- uuidflutter_cache_manager depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- clockflutter_cache_manager depends on itA fakeable wrapper for dart:core clock APIs.
- fileflutter_cache_manager depends on itPluggable, mockable file system abstraction for Dart with in-memory support.
- path_providerflutter_cache_manager depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- rxdartflutter_cache_manager depends on itImplementation of the ReactiveX API for asynchronous programming leveraging native Dart Streams.
- sqfliteflutter_cache_manager depends on itSQLite plugin for Flutter supporting iOS, Android and MacOS.
- cached_network_imageBuilt on flutter_cache_managerLoad and cache network images in Flutter with placeholder and error widget support.
- audio_serviceBuilt on flutter_cache_managerFlutter plugin for background audio playback with media controls.