RawDynamicCachedFonts class abstract
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.
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
-
cacheFont(
String url, {required int maxCacheObjects, required Duration cacheStalePeriod}) → Future< FileInfo> -
Downloads and caches font from the
url
with the given configuration. -
cacheFontStream(
String url, {required int maxCacheObjects, required Duration cacheStalePeriod, required DownloadProgressListener? progressListener}) → Stream< FileInfo> -
Downloads and caches font from the
url
with the given configuration. A singleFileInfo
object is returned as a stream and the download progress is can be listened to using theprogressListener
callback. -
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
andforce
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. -
loadCachedFamilyStream(
List< String> urls, {required String fontFamily, required ItemCountProgressListener? progressListener, FontLoader? fontLoader}) → Stream<FileInfo> -
Fetches the given
urls
from cache and loads them into the engine to be used. A stream ofFileInfo
objects is returned, which emits the font files as they are loaded. The total number of files returned corresponds to the number of urls provided. The download progress can be listened to usingprogressListener
. -
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.