NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #956 most downloaded on pub.dev
Community Edition Flutter library to load and cache network images. Can also be used with placeholder and error widgets.
Last release 10 days ago
28 Sep 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 23 of 24 stable releases
Nothing withdrawn
no release was ever pulled
7 months old
24 releases · first in 2026
One column per month.
Fix: Animated images played slower than their frame durations, e.g. 20ms GIF frames at 60% speed on a 60Hz display, because MultiImageStreamCompleter
MultiImageStreamCompleter rounded every frame up to the next vsync. Frames now follow their durations on the wall-clock timeline, skipping frames that are already late when decoding is fast enough to catch up (flutter/flutter#24804).Implemented resizing for static WebP images on disk using maxWidthDiskCache and maxHeightDiskCache .
maxWidthDiskCache and maxHeightDiskCache.maxWidthDiskCache / maxHeightDiskCache now resize WebP images on disk. Before, WebP files were stored at full size. As with JPEG and PNG, this applies when the URL path ends in .webp. Requested in issue #78.Feature: Added animate to CachedNetworkImage and CachedNetworkImageProvider (default true). With animate: false a multi-frame image such as a GIF show
animate to CachedNetworkImage and CachedNetworkImageProvider (default true). With animate: false a multi-frame image such as a GIF shows its first frame and stops there, without decoding the rest. animate is part of the provider key, so toggling it at runtime resolves a different image stream: the widget paints nothing while that stream resolves, and which frame it starts on depends on what the ImageCache still holds. Wrap the widget in a TickerMode to pause and resume an animation in place. Requested in issue #21.CachedNetworkImage.evictFromCache now forwards cacheKey to the provider it evicts and clears both the animate: true and animate: false entries, so the in-memory ImageCache eviction is no longer a silent no-op for images rendered with a cacheKey or with animate: false.fix: Prevent crashes and memory leaks in MultiImageStreamCompleter du…
fix: Prevent crashes and memory leaks in MultiImageStreamCompleter du…
MultiImageStreamCompleter re-decoded the codec on every 0→1 listener transition; for a single-frame image on CanvasKit that produces a second lazy ui.Image sharing one <img> element, and emitting it disposes the previous image, which clears that element's src. The already decoded frame is now handed to the returning listener instead. Animated images still resume decoding. Reported by @tranhuudang (issue #67).ui.Image to ImageInfo instead of a clone and never disposed _nextFrame, so every decode that was abandoned (listener dropped mid-decode) or superseded leaked a ui.Image. Frames are now cloned into ImageInfo and the decoded frame is disposed once handed over, matching the framework's MultiFrameImageStreamCompleter. That is also the ownership bug behind the black image above: setImage disposing the previous ImageInfo no longer releases a handle the codec's decoded frame still owns._decodeNextFrameAndSchedule now captures its codec and discards the frame if the codec changed during the await, instead of evaluating frameCount against the new codec — which could terminate a running animation and mis-count the new codec's frames.addListener no longer starts a decode while one is pending.setImage callback. Both released the pending frame while _handleAppFrame was still reading it. The callback now takes the frame before notifying listeners and returns quietly if the frame it was scheduled for is already gone, and decoding a codec that already has a frame in flight is a no-op.getNextFrame().Feature: Added CachedNetworkImage.preCache() static method for downloading and caching images without rendering them. Useful for warming the cache bef
CachedNetworkImage.preCache() static method for downloading and caching images without rendering them. Useful for warming the cache before navigation. Supports optional cacheKey, headers, custom cacheManager, disk-resize parameters (maxWidthDiskCache, maxHeightDiskCache), and an optional timeout. Throws a StateError instead of silently returning a stale file when refreshing an expired cache entry fails, and an ArgumentError (not just an assert) when resize parameters are used with a CacheManager that isn't an ImageCacheManager.Fix: PathNotFoundException when the background cleanup sweep deleted a cached file after getFileFromCache had already handed out its FileInfo but befo
PathNotFoundException when the background cleanup sweep deleted a cached file after getFileFromCache had already handed out its FileInfo but before the image was read. The sweep starts unawaited during initialization, so on cold start every first-frame load raced it. A cached file that disappears mid-read now falls back to a fresh download instead of throwing. Applies to the resize path too, which reads the separately-evictable original entry.getImageFile removed its in-flight resize entry only after its stream completed, so abandoning that stream left every later call for the same key waiting on a stream that had already finished, and no image was ever delivered.putFile now awaits its Hive metadata write instead of returning while the write is still unsequenced.maxNrOfCacheObjects is still honoured.reported by @aycasecr — thanks! (PR #62)
Performance: DefaultCacheManager now reuses a single HTTP client across downloads instead of creating and closing one per request, so connections can
DefaultCacheManager now reuses a single HTTP client across downloads instead of creating and closing one per request, so connections can be kept alive between images.dispose() closes the reused client. Downloads started after disposal create their own client, which is closed once its last response is released.dispose() called while a download is in flight now aborts that download; previously each download owned its client and could outlive dispose().onResponse interceptor that replaces the response must not derive the replacement body from the original response's stream — the original body is now canceled as soon as it is replaced, to release its connection.contributed by @Chlx42 — thanks! (PR #58)
The default HtmlImage web render method decodes through the browser's native pipeline and never has raw bytes available, so decode failures there neve
The default HtmlImage web render method decodes through the browser's
native pipeline and never has raw bytes available, so decode failures
there never surface as UnsupportedImageFormatException. Clarify this in
the field doc and README so the mechanism isn't overclaimed as working
on Web unconditionally.
unsupportedImageBuilder instead of errorBuilder. Previously only pre-detected formats (SVG) were routed this way via UnsupportedImageFormatException; any other codec decode failure fell through as a generic, untyped error.chore: bump version to 4.9.0 and update CHANGELOG
chore: bump version to 4.9.0 and update CHANGELOG
metadataDirectoryProvider to DefaultCacheManager so Hive metadata can be stored separately from cached image files on IO platforms.DefaultCacheManager instances sharing a cacheDirectoryProvider but different metadataDirectoryProvider no longer delete each other's files. dispose() now awaits any in-flight sweep instead of racing it.fix(cache): re-read fresh metadata in _touchEntry, final-class CacheE…
fix(cache): re-read fresh metadata in _touchEntry, final-class CacheE…
DefaultCacheManager.
CleanupStrategy abstraction controls eviction order when the cache exceeds maxNrOfCacheObjects.TtlCleanupStrategy — evicts soonest-to-expire entries first. Matches prior behaviour and remains the default.LruCleanupStrategy — evicts least-recently-used entries first, based on a new touchedAt timestamp updated on every cache hit.CacheEntryMetadata gains a nullable touchedAt field; legacy entries without it fall back to validTill via effectiveTouchedAt.cleanupStrategy parameter on DefaultCacheManager, or implement CleanupStrategy for a custom eviction policy.chore: bump version to 4.7.0 and update CHANGELOG
chore: bump version to 4.7.0 and update CHANGELOG
DefaultCacheManager.
HttpInterceptor — intercept, mutate, or short-circuit HTTP requests, responses, and errors before they reach the cache layer.CacheInterceptor — intercept cache hit, miss, and store events. Reject a hit to force re-download; resolve a miss to inject a synthetic file; reject a store to skip writing metadata to Hive.httpInterceptors and cacheInterceptors parameters on DefaultCacheManager.CacheInterceptor and its handler types are only available on native IO targets; a no-op stub is exported for web.chore: update version to 4.6.4 and add changelog entry for Hive key s…
chore: update version to 4.6.4 and add changelog entry for Hive key s…
HiveError crashes caused by URL string keys exceeding 255 characters. Long cache keys are now automatically hashed using SHA-256 to remain under Hive's 255-character length limit.chore: Update version numbers to 4.6.3 and 2.1.1 in pubspec.yaml and …
chore: Update version numbers to 4.6.3 and 2.1.1 in pubspec.yaml and …
dispose(). (PR #17)
PathNotFoundException (e.g. when the cache directory was deleted before dispose) is now silently swallowed so callers can dispose without wrapping in try-catch.PathNotFoundException on first use when the OS or test harness removes the temp directory between initialisation and the first cache put/get.emptyCache(). (PR #17)fix: Update CHANGELOG for version 4.6.2, fixes Hive box corruption re…
fix: Update CHANGELOG for version 4.6.2, fixes Hive box corruption re…
openBox encounters a corrupted box with unknown typeIds (e.g., from removed adapters), catch HiveError, safely delete the box, and retry initialization.Fix: Re-export ConnectionParameters from the main cached_network_image_ce barrel file so it is accessible without a separate cached_network_image_plat
ConnectionParameters from the main cached_network_image_ce barrel file so it is accessible without a separate cached_network_image_platform_interface_ce import.connectionParameters parameter to the stub DefaultCacheManager for unsupported platforms.DefaultCacheManager with ConnectionParameters.Feature: Added optional HTTP timeout support via ConnectionParameters on DefaultCacheManager.
ConnectionParameters on DefaultCacheManager.
connectionTimeout limits time waiting for response headers.requestTimeout applies an inactivity timeout while streaming response bytes.connectionParameters is not provided.Feature: Added web platform support. The package can now be used in Flutter web apps.
DefaultCacheManager is now conditionally imported per platform (IO/web).Feature: Skip placeholder and fade animations when images are loaded from disk cache. Cached images now appear instantly without unnecessary visual fl
disablePlaceholderOnCacheHit parameter (default true) to opt out of this behavior.CachedNetworkImage is now a StatefulWidget to support async cache pre-checking.Feature/Deprecation: Added errorBuilder to CachedNetworkImage and CachedImageWidget, which aligns with Flutter's standard ImageErrorWidgetBuilder. The…
errorBuilder to CachedNetworkImage and CachedImageWidget, which aligns with Flutter's standard ImageErrorWidgetBuilder. The old errorWidget property is now deprecated.errorListener would prevent CachedNetworkImage from being garbage collected. Uses addEphemeralErrorListener on Flutter >= 3.16.Feature: Added SVG support via new unsupportedImageBuilder callback
unsupportedImageBuilder callback
UnsupportedImageFormatException thrown when image format is not supported by Flutter's standard codecImageFormatDetector utility with content sniffing for SVG detectionflutter_svgFix: Removed global Hive.init() usage from DefaultCacheManager to avoid conflicts with host app Hive initialization
Hive.init() usage from DefaultCacheManager to avoid conflicts with host app Hive initializationDefaultCacheManager to prevent parallel cold-start race conditionsopenBox(path: ...) on a private Hive instance for reliable isolationcacheDirectoryProvider parameter to DefaultCacheManager so apps can control cache storage locationFeature: Added httpClientFactory parameter to DefaultCacheManager for HTTP client dependency injection, enabling easy mocking in tests
httpClientFactory parameter to DefaultCacheManager for HTTP client dependency injection, enabling easy mocking in testsMap<String, dynamic> with typed CacheEntryMetadata class for all cache metadata operationsDefaultCacheManager: HTTP download success/errors, progress reporting, header forwarding, cache hit/miss/stale behavior, cleanup logic (31 tests)http.Client cleanup, file sink closure, ImageLoader chunkEvents, MultiImageStreamCompleter disposal, Hive box lifecycle (19 tests)ImageLoader, CachedNetworkImageProvider, CacheEntryMetadata coverageAdded repository field for pub.dev source code display
repository field for pub.dev source code display_ce suffixed packagesNothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →