Browse Source

Fix cach keys

Vishnu Mohandas 5 years ago
parent
commit
90a2a44aec
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lib/core/cache/image_cache.dart
  2. 1 1
      lib/core/cache/thumbnail_cache.dart

+ 2 - 2
lib/core/cache/image_cache.dart

@@ -7,10 +7,10 @@ class ImageLruCache {
   static LRUMap<int, File> _map = LRUMap(500);
 
   static File get(Photo photo) {
-    return _map.get(photo.generatedId);
+    return _map.get(photo.hashCode);
   }
 
   static void put(Photo photo, File imageData) {
-    _map.put(photo.generatedId, imageData);
+    _map.put(photo.hashCode, imageData);
   }
 }

+ 1 - 1
lib/core/cache/thumbnail_cache.dart

@@ -26,7 +26,7 @@ class _ThumbnailCacheKey {
       identical(this, other) ||
       other is _ThumbnailCacheKey &&
           runtimeType == other.runtimeType &&
-          photo.generatedId == other.photo.generatedId &&
+          photo.hashCode == other.photo.hashCode &&
           size == other.size;
 
   @override