decodedCacheRatioCap property

double decodedCacheRatioCap

The maximum multiple of the compressed image size used when caching an animated image.

By default individual frames of animated images are cached into memory to avoid using CPU to re-decode them for every loop in the animation. This behavior will result in out-of-memory crashes when decoding large (or large numbers of) animated images. Set this value to limit how much memory each animated image is allowed to use to cache decoded frames compared to its compressed size. For example, setting this to 2.0 means that a 400KB GIF would be allowed at most to use 800KB of memory caching unessential decoded frames. A setting of 1.0 or less disables all caching of unessential decoded frames. See _kDefaultDecodedCacheRatioCap for the default value.

Implementation

double get decodedCacheRatioCap => _kDecodedCacheRatioCap;
void decodedCacheRatioCap= (double value)

Changes the maximum multiple of compressed image size used when caching an animated image.

Changing this value only affects new images, not images that have already been decoded.

Implementation

set decodedCacheRatioCap(double value) {
  assert (value != null);
  assert (value >= 0.0);
  _kDecodedCacheRatioCap = value;
}