fluttercommunity / fluttercommunity/flutter_blurhash
CacheManager
- Dominant language
- Dart
- Stars
- 574
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
Is there a way to control CacheManager?
Today we have added Blurhash like below, but I noticed we could also add in the actual url to blurhash as a parameter, and thus perhaps we could eliminate a lot of our own code (and hopefully piggyback-ride onto an smoother transition from blur to image).
```dart
CachedNetworkImage(
imageUrl: url,
fadeInCurve: Curves.linear,
fadeOutCurve: Curves.linear,
fit: BoxFit.cover,
width: width,
height: height,
fadeInDuration: Duration(milliseconds: 250),
fadeOutDuration: Duration(milliseconds: 250),
cacheManager: CacheManager(
Config(
url,
maxNrOfCacheObjects: 500,
stalePeriod: stalePeriod ?? const Duration(days: 30),
),
),
placeholder: Stack(
fit: StackFit.expand,
children: [
BlurHash(
hash: image.blurhash,
imageFit: BoxFit.cover,
),
Center(
child: LoadingSpinner(
radius: spinnerRadius ?? 15,
strokeWidth: spinnerStrokeWidth ?? 1,
),
),
],
),
errorWidget: (context, _, __) => ProfilePlaceholder(width: width, height: height),
)
```
However, it would be ideal for us to control errorWidget as well as the cacheManager.
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue does not name source files or tests. Start by locating the Flutter widget entry point and inspect how it currently configures CachedNetworkImage; done means callers can provide both an errorWidget and a cacheManager, with tests covering those options.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- api, mobile-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100