removeCachedFont static method

Future<void> removeCachedFont(
  1. String url
)

Removes the given url can be loaded directly from cache.

Call canLoadFont before calling this method to make sure the font is available in cache.

  • REQUIRED The url property is used to specify the url for the required font. It should be a valid http/https url which points to a font file. The url should match the url passed to cacheFont.

Implementation

static Future<void> removeCachedFont(String url) async {
  WidgetsFlutterBinding.ensureInitialized();

  final String cacheKey = Utils.sanitizeUrl(url);

  await DynamicCachedFontsCacheManager.getCacheManager(cacheKey)
      .removeFile(cacheKey);
}