getUrlBytes static method
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;
}
});
}