Baseflow / Baseflow/flutter_cached_network_image
How can I add image to cache manually.
- Dominant language
- Dart
- Stars
- 2.6k
- Forks
- 731
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
Hi here, I want to add some images to cache manager manually for CachedNetworkImage. My code below doesn't work so what can I do to achieve that?
```
// storing cache
String imageUrl = 'some url';
String cacheKey = 'some_key';
DefaultCacheManager cacheManager = DefaultCacheManager();
await cacheManager.downloadFile(imageUrl, key: cacheKey);
// render image
CachedNetworkImage(
cacheManager: cacheManager,
cacheKey: cacheKey,
imageUrl: 'imageUrl',
),
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the CachedNetworkImage and DefaultCacheManager usage shown in the issue, especially downloadFile and the cacheKey/imageUrl values. Reproduce the reported behavior in a minimal Flutter app and verify whether the manually cached image is rendered; the issue is done when the supported way to preload and display that image is documented or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100