configureDigiaImageCache function

void configureDigiaImageCache({
  1. int imageDiskCacheBytes = SdkConfig.defaultMediaDiskCacheBytes,
})

Points the image loader's process-wide default at DigiaImageCacheManager, scaled to imageDiskCacheBytes. Called once at SDK init with the default budget, and again whenever the server config resolves (cached at init, then the fetched answer). Tests install their own default instead (see useRealImageCache), which is why this is a call rather than a static initializer.

Implementation

void configureDigiaImageCache({
  int imageDiskCacheBytes = SdkConfig.defaultMediaDiskCacheBytes,
}) {
  // Always logged, even when the object count below is unchanged: the applied
  // budget is otherwise only provable via code path and behavior.
  _log.d('Image disk cache configured '
      '(imageDiskCacheBytes=$imageDiskCacheBytes)');

  DigiaImageCacheManager.configure(imageDiskCacheBytes: imageDiskCacheBytes);
}