|
|
@@ -125,6 +125,7 @@ class CachedNetworkImageProvider
|
|
|
final Widget? placeholder;
|
|
|
final Widget? errorWidget;
|
|
|
final bool cached;
|
|
|
+ final bool useUrl = false;
|
|
|
final String? cacheKey;
|
|
|
final Widget? loadwidget;
|
|
|
final Map<String, String>? httpHeaders;
|
|
|
@@ -179,7 +180,11 @@ class CachedNetworkImageProvider
|
|
|
if (cacheKey != null) {
|
|
|
fileInfo = await defaultCacheManager.getFileFromCache(cacheKey!);
|
|
|
} else {
|
|
|
- fileInfo = await defaultCacheManager.getFileFromCache(imageUrl);
|
|
|
+ if (useUrl) {
|
|
|
+ fileInfo = await defaultCacheManager.getFileFromCache(imageUrl);
|
|
|
+ } else {
|
|
|
+ throw Exception('Failed to load image');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (fileInfo != null) {
|