evict method

bool evict (Object key)

Evicts a single entry from the cache, returning true if successful.

The key must be equal to an object used to cache an image in ImageCache.putIfAbsent.

If the key is not immediately available, as is common, consider using ImageProvider.evict to call this method indirectly instead.

See also:

Implementation

bool evict(Object key) {
  final _CachedImage image = _cache.remove(key);
  if (image != null) {
    _currentSizeBytes -= image.sizeBytes;
    return true;
  }
  return false;
}