If loading an image fails with maxHeightDiskCache specified, errorWidget will not be called next time.
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Comienza reproduciendo el ejemplo de Dart/Flutter con maxWidthDiskCache o maxHeightDiskCache y una URL de imagen que falle; después, inspecciona el comportamiento de CachedNetworkImage y evictFromCache implicado en la segunda carga. La tarea estará terminada cuando las imágenes que fallen no impidan que se llame a errorWidget en cargas posteriores y la expulsión de la caché se comporte como se espera.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 Bug Report
As the title says, if CachedNetworkImage with maxHeightDiskCache (or maxWidthDiskCache) fails to load an image (403, etc.), errorWidget is called the first time, but not the next time.
I think it is probably due to the fact that the image that failed to load is cached, but is there a solution?
I would like to add that I have tried deleting the cache, but it is not possible to do so.
Thanks for the answer.
Expected behavior
Images that fail to load are not cached.
Reproduction steps
return CachedNetworkImage(
imageUrl: path, // Path of the image that results in a 403 error
width: 128,
height: 128,
maxWidthDiskCache: 128,
maxHeightDiskCache: 128,
errorWidget: (context, url, error) {
// First time through, but after that it goes through.
return const SizedBox.shrink();
},
placeholder: (context, url) {
// errorWidget is not called, so it is here to stay
return const CircularProgressIndicator();
},
imageBuilder: (context, imageProvider) {
// omission
},
errorListener: (value) async {
// It tries to delete the cache, but it is always false.
final result = CachedNetworkImage.evictFromCache(path);
print('delete cache: $result'); // delete cache: false
},
);
Configuration
Version:
- Flutter: 3.24.3
- cached_network_image: 3.4.1
Platform:
- 📱 iOS
- 🤖 Android
- Lenguaje dominante
- Dart
- Estrellas
- 2.6k
- Forks
- 731
- Merge medio
- 4 d 12 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Baseflow/flutter_cached_network_image
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Baseflow/flutter_cached_network_image#492 · 2 reacciones ·
Los mantenedores suelen responder en 4 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Baseflow/flutter_cached_network_image#478 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Baseflow/flutter_cached_network_image#473 ·
Los mantenedores suelen responder en 4 días
-
Package not Support .jfif FormatAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Baseflow/flutter_cached_network_image#1032 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Baseflow/flutter_cached_network_image#1031 ·
Los mantenedores suelen responder en 4 días
Todos los issues de Baseflow/flutter_cached_network_image
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
MaikuB/flutter_local_notifications#2838 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
jiangtian616/JHenTai#833 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100