PCacheImageService class

TODO change cachedPaths to a Hive box (persistence) Paulonia cache image service for mobile

This class has all function to download, store and get the images.

Constructors

PCacheImageService()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

cachedPaths Set<String>
no setter
length int
Gets the number of cached images in the actual session
no setter

Static Methods

clearAllImages() Future<void>
Clears all the images from the local storage
downloadImage(String url, Duration retryDuration, Duration maxRetryDuration) Future<Uint8List>
Downloads the image
fileIsCached(File file) bool
Verifies if file is stored on cache
getImage(String url, Duration retryDuration, Duration maxRetryDuration, bool enableCache, {bool clearCacheImage = false}) Future<Codec>
Get the image codec
init({String? proxy}) Future<void>
Initialize the service on mobile
saveFile(File file, Uint8List bytes) → void
Saves the file in the local storage