getMemoryImageCache function Null safety

ImageCache? getMemoryImageCache(
  1. [String? name]
)

get ImageCache

Implementation

ImageCache? getMemoryImageCache([String? name]) {
  if (name != null) {
    if (imageCaches.containsKey(name)) {
      return imageCaches[name];
    } else {
      return null;
    }
  } else {
    return PaintingBinding.instance?.imageCache;
  }
}