ub3lal 1 month ago
parent
commit
ecff5b66bc
1 changed files with 6 additions and 3 deletions
  1. 6 3
      lib/src/bloc/cashed_image_bloc.dart

+ 6 - 3
lib/src/bloc/cashed_image_bloc.dart

@@ -21,9 +21,12 @@ class CashedImageBloc extends Bloc<CashedImageEvent, CashedImageState> {
       );
 
       if (event.cached) {
-        FileInfo? fileInfo = await defaultCacheManager.getFileFromCache(
-          event.url,
-        );
+        FileInfo? fileInfo;
+        if (event.cachkey != null) {
+          fileInfo = await defaultCacheManager.getFileFromCache(event.cachkey!);
+        } else {
+          fileInfo = await defaultCacheManager.getFileFromCache(event.url);
+        }
 
         if (fileInfo != null) {
           emit(CashedImageGetState(bytes: await fileInfo.file.readAsBytes()));