FastCachedImageConfig class
FastCachedImageConfig is the class to manage and set the cache configurations.
Constructors
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 Methods
-
clearAllCachedImages(
{bool showLog = true}) → Future< void> - clearAllCachedImages function clears all cached images. This can be used in scenarios such as logout functionality of your app, so that all cached images corresponding to the user's account is removed.
-
deleteCachedImage(
{required String imageUrl, bool showLog = true}) → Future< void> -
deleteCachedImage function takes in a image
imageUrl
and removes the image corresponding to the url from the cache if the image is present in the cache. -
init(
{String? subDir, Duration? clearCacheAfter}) → Future< void> -
init function initializes the cache management system. Use this code only once in the app in main to avoid errors.
You can provide a
subDir
where the boxes should be stored.clearCacheAfter
property is used to set a duration after which the cache will be cleared. Default value ofclearCacheAfter
is 7 days which means ifclearCacheAfter
is set to null, an image cached today will be cleared when you open the app after 7 days from now. -
isCached(
{required String imageUrl}) → bool - isCached returns a boolean indicating whether the given image is cached or not. Returns true if cached, false if not.