getImage static method

ImageProvider<Object> getImage(
  1. String gsUrl, {
  2. String? id,
})

Gets the ImageProvider of the provided gsUrl

If id is null then used the gsUrl as id. If it's the first call using the id, then it creates a PCacheImage and stores it. Otherwise returns the already cached ImageProvider. The store ImageProvider may be removed once a limit is reached.

Implementation

static ImageProvider getImage(String gsUrl, {String? id}) {
  id ??= gsUrl;

  PImageInfo? imageInfo = _imageProviders[id];
  imageInfo ??= _addImageProvider(gsUrl, id);

  return imageInfo.image;
}