Open
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(),
),
),
);
}
Metadata
Metadata
Assignees
Labels
No labels