clearCache method

void clearCache()

Removes all cached images.

This calls Image.dispose for all images in the cache, so make sure that you don't use any of the previously cached images once clearCache has been called.

Implementation

void clearCache() {
  _assets.forEach((_, asset) => asset.dispose());
  _assets.clear();
}