Baseflow / Baseflow/flutter_cached_network_image

Using memCache to cache images makes the fit configuration ineffective.

Open
#969 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

Expected behavior

The images should not reload when scrolling through the list and the fit configuration should work properly even when using memCache for caching.

Reproduction steps

Use version cached_network_image: ^3.4.1.
The app is on a multi-platform including iOS and Android.
The server returns high-definition image addresses. When scrolling through a Flutter list and an image goes off-screen and then comes back into view, the already loaded image reloads.
Try to use memCache to configure caching, but after caching, the fit configuration for images of different sizes does not take effect, resulting in the image being stretched.

Configuration

Version: cached_network_image: ^3.4.1

```
Widget netWorkImage(String url,
{double? width,
double? height,
double? radius,
int? memCacheWidth,
int? memCacheHeight,
BoxFit fit = BoxFit.cover,
Function()? onPressed}) {
return PressOpacity(
onPressed: onPressed,
child: ClipRRect(
borderRadius: BorderRadius.circular(radius ?? 0),
child: CachedNetworkImage(
width: width,
height: height,
memCacheWidth: memCacheWidth,
memCacheHeight: memCacheHeight,
fit: fit,
imageUrl: url,
placeholder: (context, url) => loadingPlaceHolder(),
),
),
);
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.