DigiaLottieCacheManager class final
The SDK-owned Lottie file cache. Freshness, ETag revalidation and cleanup use CacheManager's built-in policy, just as raster images do. SVG does not use it.
Constructors
- DigiaLottieCacheManager()
-
factory
Properties
- config → Config
-
Get the config
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- store → CacheStore
-
Get the underlying store helper
no setterinherited
- webHelper → WebHelper
-
Get the underlying web helper
no setterinherited
Methods
-
dispose(
) → Future< void> -
Closes the cache database
inherited
-
downloadFile(
String url, {String? key, Map< String, String> ? authHeaders, bool force = false}) → Future<FileInfo> -
Download the file and add to cache
inherited
-
emptyCache(
) → Future< void> -
Removes all files from the cache
inherited
-
getFile(
String url, {String? key, Map< String, String> ? headers}) → Stream<FileInfo> -
Get the file from the cache and/or online, depending on availability and age.
Downloaded form
url,headerscan be used for example for authentication. The files are returned as stream. First the cached file if available, when the cached file is too old the newly downloaded file is returned afterwards.inherited -
getFileFromCache(
String key, {bool ignoreMemCache = false}) → Future< FileInfo?> -
Get the file from the cache.
Specify
ignoreMemCacheto force a re-read from the databaseinherited -
getFileFromMemory(
String key) → Future< FileInfo?> -
Returns the file from memory if it has already been fetched
inherited
-
getFileStream(
String url, {String? key, Map< String, String> ? headers, bool withProgress = false}) → Stream<FileResponse> -
Get the file from the cache and/or online, depending on availability and age.
Downloaded form
url,headerscan be used for example for authentication. The files are returned as stream. First the cached file if available, when the cached file is too old the newly downloaded file is returned afterwards.inherited -
getSingleFile(
String url, {String? key, Map< String, String> ? headers}) → Future<File> -
Get the file from the cache and/or online, depending on availability and age.
Downloaded form
url,headerscan be used for example for authentication. When a file is cached and up to date it is return directly, when the cached file is too old the file is downloaded and returned after download. When a cached file is not available the newly downloaded file is returned.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
putFile(
String url, Uint8List fileBytes, {String? key, String? eTag, Duration maxAge = const Duration(days: 30), String fileExtension = 'file'}) → Future< File> -
Put a file in the cache. It is recommended to specify the
eTagand themaxAge. WhenmaxAgeis passed and the eTag is not set the file will always be downloaded again. ThefileExtensionshould be without a dot, for example "jpg". When cache info is available for the url that path is re-used. The returnedFileis saved on disk.inherited -
putFileStream(
String url, Stream< List< source, {String? key, String? eTag, Duration maxAge = const Duration(days: 30), String fileExtension = 'file'}) → Future<int> >File> -
Put a byte stream in the cache. When using an existing file you can use
file.openRead(). It is recommended to specify the
eTagand themaxAge. WhenmaxAgeis passed and the eTag is not set the file will always be downloaded again. ThefileExtensionshould be without a dot, for example "jpg". When cache info is available for the url that path is re-used. The returnedFileis saved on disk.inherited -
removeFile(
String key) → Future< void> -
Remove a file from the cache
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
maxObjectsForBytes(
int bytes) → int - The wire budget is an estimate: CacheManager limits files, not bytes.
Constants
- bytesPerCacheObject → const int
- cacheKey → const String
- stalePeriod → const Duration