clear method
Removes the image name from the cache.
No error is raised if the image name is not present in the cache.
This calls Image.dispose, so make sure that you don't use the previously cached image once it is cleared (removed) from the cache. The image is removed even if it is retained.
Implementation
void clear(String name) {
final removedAsset = _assets.remove(name);
removedAsset?.dispose();
}