cached_network_image library

Flutter library to load and cache network images. Can also be used with placeholder and error widgets.

Classes

BaseCacheManager
Abstract interface for cache managers.
CachedNetworkImage
Image widget to show NetworkImage with caching functionality.
CachedNetworkImageProvider
IO implementation of the CachedNetworkImageProvider; the ImageProvider to load network images using a cache.
CacheEntryMetadata
Typed metadata for a cached file entry, stored in Hive.
CacheHitData
Data passed to CacheInterceptor.onHit.
CacheHitHandler
Handler for CacheInterceptor.onHit.
CacheInterceptor
Abstract interceptor for cache lookup and storage events.
CacheManager
Concrete base implementation of BaseCacheManager.
CacheMissData
Data passed to CacheInterceptor.onMiss.
CacheMissHandler
Handler for CacheInterceptor.onMiss.
CacheStoreData
Data passed to CacheInterceptor.onStore.
CacheStoreHandler
Handler for CacheInterceptor.onStore.
CleanupStrategy
Defines the order in which cache entries are evicted when the cache exceeds DefaultCacheManager.maxNrOfCacheObjects.
ConnectionParameters
Configuration for HTTP connection and request timeouts used by DefaultCacheManager when downloading files.
DefaultCacheManager
Stub DefaultCacheManager for unsupported platforms.
DownloadProgress
Progress of the file that is being downloaded from the originalUrl.
FileInfo
FileInfo contains the fetched File next to some info on the validity and the origin of the file.
FileResponse
Base class for responses from the cache manager.
HttpErrorHandler
Handler for HttpInterceptor.onError.
HttpInterceptor
Abstract interceptor for HTTP requests and responses.
HttpRequestData
Mutable request data passed through the HTTP interceptor chain.
HttpRequestHandler
Handler for HttpInterceptor.onRequest.
HttpResponseData
Immutable response data passed through the HTTP interceptor chain.
HttpResponseHandler
Handler for HttpInterceptor.onResponse.
ImageFormatDetector
Utility to detect image formats that are not supported by Flutter's standard image codec (e.g. SVG).
LruCleanupStrategy
Evicts least-recently-used entries first (LRU-based).
MultiImageStreamCompleter
An ImageStreamCompleter with support for loading multiple images.
TtlCleanupStrategy
Evicts entries with the earliest expiry date first (TTL-based).

Enums

CacheManagerLogLevel
Log levels of the cache manager. Debug shows failed downloads and verbose also shows successful downloads and cache retrievals.
FileSource
Enum for whether the file is coming from the cache or is just downloaded.
ImageRenderMethodForWeb
Render options for images on the web platform.

Mixins

ImageCacheManager
Extended cache manager with image-specific methods.

Properties

timeDilation double
Slows down animations by this factor to help in development.
no setter

Typedefs

ImageWidgetBuilder = Widget Function(BuildContext context, ImageProvider<Object> imageProvider)
Builder function to create an image widget. The function is called after the ImageProvider completes the image loading.
LoadingErrorWidgetBuilder = Widget Function(BuildContext context, String url, Object error)
Builder function to create an error widget. This builder is called when the image failed loading, for example due to a 404 NotFound exception.
PlaceholderWidgetBuilder = Widget Function(BuildContext context, String url)
Builder function to create a placeholder widget. The function is called once while the ImageProvider is loading the image.
ProgressIndicatorBuilder = Widget Function(BuildContext context, String url, DownloadProgress progress)
Builder function to create a progress indicator widget. The function is called every time a chuck of the image is downloaded from the web, but at least once during image loading.
UnsupportedImageWidgetBuilder = Widget Function(BuildContext context, String url, Uint8List bytes)
Builder function to create a widget for images whose format is not supported by Flutter's standard image codec (e.g. SVG).

Exceptions / Errors

HttpExceptionWithStatus
An HTTP exception that includes the HTTP status code.
UnsupportedImageFormatException
Exception thrown when the image bytes cannot be decoded by Flutter's standard image codec (e.g. SVG images).