getUrlBytes static method

Future<Uint8List> getUrlBytes(
  1. String url
)

Retrieves downloaded bytes from cache or downloads them if not present.

Implementation

static Future<Uint8List> getUrlBytes(String url) {
  return _downloadedUrlBytesCache.putIfAbsent(url, () async {
    try {
      return await _downloadUrl(url);
    } catch (e) {
      _downloadedUrlBytesCache.remove(url);
      rethrow;
    }
  });
}