File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
cached_network_image/lib/src Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class CachedNetworkImage extends StatelessWidget {
55
55
BaseCacheManager ? cacheManager,
56
56
double scale = 1 ,
57
57
}) async {
58
- final effectiveCacheManager = cacheManager ?? DefaultCacheManager () ;
58
+ final effectiveCacheManager = cacheManager ?? CachedNetworkImageProvider .defaultCacheManager ;
59
59
await effectiveCacheManager.removeFile (cacheKey ?? url);
60
60
return CachedNetworkImageProvider (url, scale: scale).evict ();
61
61
}
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ class CachedNetworkImageProvider
34
34
/// CacheManager from which the image files are loaded.
35
35
final BaseCacheManager ? cacheManager;
36
36
37
+ /// The default cache manager used for image caching.
38
+ static DefaultCacheManager defaultCacheManager = DefaultCacheManager ();
39
+
37
40
/// Web url of the image to load
38
41
final String url;
39
42
@@ -113,7 +116,7 @@ class CachedNetworkImageProvider
113
116
cacheKey,
114
117
chunkEvents,
115
118
decode,
116
- cacheManager ?? DefaultCacheManager () ,
119
+ cacheManager ?? defaultCacheManager ,
117
120
maxHeight,
118
121
maxWidth,
119
122
headers,
@@ -166,7 +169,7 @@ class CachedNetworkImageProvider
166
169
cacheKey,
167
170
chunkEvents,
168
171
decode,
169
- cacheManager ?? DefaultCacheManager () ,
172
+ cacheManager ?? defaultCacheManager ,
170
173
maxHeight,
171
174
maxWidth,
172
175
headers,
You can’t perform that action at this time.
0 commit comments