custom static method

  1. @visibleForTesting
void custom(
  1. {required CacheManager cacheManager,
  2. bool force = false}
)

Accepts cacheManager and force to provide a custom CacheManager for testing.

  • REQUIRED The cacheManager property is used to specify a custom instance of CacheManager. Caching can be customized using the Config object passed to the instance.

  • The force property is used to specify whether or not to overwrite an existing instance of custom cache manager.

    If force is true and a custom cache manager already exists, it will be overwritten with the new instance. This means any fonts cached earlier, cannot be accessed using the new instance.


Any new DynamicCachedFonts instance or any RawDynamicCachedFonts methods called after this method will use cacheManager to download, cache and load fonts. This means custom configuration cannot be provided.

maxCacheObjects and cacheStalePeriod will have no effect after calling this method. Customize these values in the Config object passed to the CacheManager used in cacheManager.

Implementation

@visibleForTesting
static void custom({
  required CacheManager cacheManager,
  bool force = false,
}) =>
    RawDynamicCachedFonts.custom(
      cacheManager: cacheManager,
      force: force,
    );