dynamic_cached_fonts library

An asset loader which dynamically loads font from the given url and caches it. It can be easily fetched from cache and loaded on demand.

Classes

BaseCacheManager
Interface of the CacheManager. In general CacheManager can be used directly.
CacheInfoRepository
Base class for cache info repositories
CacheLogger
CacheLogger which is used by the cache manager to log useful information
CacheManager
Flutter Cache Manager Copyright (c) 2019 Rene Floor Released under MIT License. Basic cache manager implementation, which should be used as a single instance.
CacheObjectProvider
Config
DefaultCacheManager
The DefaultCacheManager that can be easily used directly. The code of this implementation can be used as inspiration for more complex cache managers.
DownloadProgress
Progress of the file that is being downloaded from the originalUrl.
DynamicCachedFonts
Allows dynamically loading fonts from the given url.
FileFetcherResponse
FileInfo
FileInfo contains the fetch File next to some info on the validity and the origin of the file.
FileResponse
FileService
Flutter Cache Manager Copyright (c) 2019 Rene Floor Released under MIT License. Defines the interface for a file service. Most common file service will be an HttpFileService, however one can also make something more specialized. For example you could fetch files from other apps or from local storage.
FileServiceResponse
Defines the interface for a get result of a FileService.
HttpFileFetcherResponse
Deprecated
HttpFileService
HttpFileService is the most common file service and the default for WebHelper. One can easily adapt it to use dio or any other http client.
HttpGetResponse
Basic implementation of a FileServiceResponse for http requests.
JsonCacheInfoRepository
NonStoringObjectProvider
RawDynamicCachedFonts
A more customizable implementation of DynamicCachedFonts which uses multiple static methods to download, cache, load and remove font assets.

Enums

CacheManagerLogLevel
Log levels of the cache manager. Debug shows failed downloads and verbose also shows successful downloads and cache retrievals.
FileSource
Flutter Cache Manager Copyright (c) 2019 Rene Floor Released under MIT License. Enum for whether the file is coming from the cache or is just downloaded.

Constants

supportedFileNames → const List<String>

Properties

cacheLogger CacheLogger
Instance of the cache manager. Can be set to a custom one if preferred.
getter/setter pair

Functions

cacheKeyFromUrl(String url) String
Gets the sanitized url from url which is used as cacheKey when downloading, caching or loading.

Typedefs

FileFetcher = Future<FileFetcherResponse> Function(String url, {Map<String, String>? headers})
Flutter Cache Manager Copyright (c) 2019 Rene Floor Released under MIT License. Deprecated FileFetcher function

Exceptions / Errors

HttpExceptionWithStatus