MemoryImageCacheService class

Singleton service for image fetching, decoding, and in-memory caching.

Constructors

MemoryImageCacheService()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCache({String? url}) → void
Clears the cache (entirely or for a single URL).
getDecodedIfAvailable(String url) Image?
Returns decoded ui.Image if available.
getDecodedImage(String url) Future<Image?>
Returns decoded image, fetching and caching if necessary.
getIfAvailable(String url) Uint8List?
Returns raw bytes if already cached.
init({required ImageCacheStrategy strategy, required FetchImageFunction fetchFunction, Duration fetchTimeout = const Duration(seconds: 8), DecodeImageFunction? decodeFunction}) → void
Initialize the service with a caching strategy and fetch/decoder functions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prefetchImages(Iterable<String> urls) → void
Prefetch images in the background.
toString() String
A string representation of this object.
inherited
waitForAllFetches() Future<void>
Awaits the completion of all ongoing image fetches.

Operators

operator ==(Object other) bool
The equality operator.
inherited