RawDynamicCachedFonts class Null safety

A more customizable implementation of DynamicCachedFonts which uses multiple static methods to download, cache, load and remove font assets.

DynamicCachedFonts is a concrete implementation of this class.


hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Methods

cacheFont(String url, {required int maxCacheObjects, required Duration cacheStalePeriod}) Future<FileInfo>
Downloads and caches font from the url with the given configuration. [...]
canLoadFont(String url) Future<bool>
Checks whether the given url can be loaded directly from cache. [...]
custom({required CacheManager cacheManager, bool force = false}) → void
Accepts cacheManager and force to provide a custom CacheManager for testing. [...]
loadCachedFamily(List<String> urls, {required String fontFamily, FontLoader? fontLoader}) Future<Iterable<FileInfo>>
Fetches the given urls from cache and loads them into the engine to be used. [...]
loadCachedFont(String url, {required String fontFamily, FontLoader? fontLoader}) Future<FileInfo>
Fetches the given url from cache and loads it as an asset. [...]
removeCachedFont(String url) Future<void>
Removes the given url can be loaded directly from cache. [...]