precached_network_image
1.4.1, released 11 months ago by janlionly.dev
Load and cache network images to disk and memory to avoid display delays.
What it does
Provides a widget and manager to load, disk-cache, and memory-precache network images in Flutter applications. It helps prevent flash screens or flickering caused by network image download delays across iOS, Android, and Web.
AI-written summary of version 1.4.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to avoid network image loading delay and flashing/flickering on screen.
- You need dual-layer caching (memory and disk) for network images with explicit precaching control.
Skip it when
- You require advanced image manipulation features like cropping or complex transformations.
- You are already using a comprehensive image handling solution like cached_network_image.
Strengths
- Supports dual-layer caching with memory and disk storage.
- Provides manual precaching controls via a manager class.
- Supports multi-platform including iOS, Android, and Web.
Weaknesses
- Lacks advanced image transformations, cropping, or editing features.
- Relies on manual manager calls for advanced precaching workflows.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
not documented
PrecachedNetworkImage(
url: 'https://picsum.photos/200',
width: 200,
height: 200,
precache: true,
fit: BoxFit.fill,
placeholder: (context, url) => const Icon(Icons.person),
errorWidget: (context, url, error) => const Icon(Icons.error),
)Alternatives
Packages that do the same job and could replace precached_network_image.
- cached_network_image
It is a more widely adopted, robust package for downloading, caching, and displaying network images.
91Compare - octo_image
It provides advanced placeholder and error building strategies for network images.
94Compare
Works with
Packages commonly used together with precached_network_image: ones it builds on, ones built on it, and its own family.
- cryptoprecached_network_image depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- path_providerprecached_network_image depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- shared_preferencesprecached_network_image depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.