Procházet zdrojové kódy

[fix]修复预览原图后没清缓存

云天逵 před 11 měsíci
rodič
revize
3d5a22d475

+ 4 - 4
lib/module/calendar/preview/calendar_preview_controller.dart

@@ -93,15 +93,13 @@ class CalendarPreviewController extends BaseController
     CardSwiperDirection direction,
   ) {
     debugPrint(
-      'The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top',
+      'onSwipe The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top',
     );
 
     if (currentIndex != null) {
       groupIndex.value = currentIndex;
     }
-    // 预加载
 
-    // precacheImage(AssetEntityImageProvider(entity), context);
 
     // 如果direction是left,
     if (direction == CardSwiperDirection.left) {
@@ -125,6 +123,7 @@ class CalendarPreviewController extends BaseController
     }
 
     updateSelectedFilesSize();
+
     return true;
   }
 
@@ -134,7 +133,7 @@ class CalendarPreviewController extends BaseController
     CardSwiperDirection direction,
   ) {
     debugPrint(
-        'The card $currentIndex was swiped back to the ${direction.name}. Now the card $previousIndex is on top');
+        'onSwiperUndo The card $currentIndex was swiped back to the ${direction.name}. Now the card $previousIndex is on top');
 
     groupIndex.value = currentIndex;
     //   撤销之前左滑的操作
@@ -268,6 +267,7 @@ class CalendarPreviewController extends BaseController
         photoGroup.value.selectedTotalSize.value = totalSize;
       },
     );
+    PhotoManager.clearFileCache();
   }
 
   void restoreSelections() {

+ 5 - 4
lib/module/photo_preview/photo_preview_controller.dart

@@ -201,7 +201,7 @@ class PhotoPreviewController extends BaseController
         selectedFilesSize.value = totalSize;
       },
     );
-
+    PhotoManager.clearFileCache();
   }
 
 
@@ -288,7 +288,7 @@ class PhotoPreviewController extends BaseController
     CardSwiperDirection direction,
   ) {
     print(
-      'The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top',
+      'onSwipe The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top',
     );
     if (currentIndex != null) {
       groupIndex.value = currentIndex;
@@ -311,6 +311,7 @@ class PhotoPreviewController extends BaseController
     }
     selectedFileCount.value = selectedPhotosIds.length;
     updateSelectedFilesSize();
+
     return true;
   }
 
@@ -321,7 +322,7 @@ class PhotoPreviewController extends BaseController
   ) {
 
     print(
-        'The card $currentIndex was swiped back to the ${direction.name}. Now the card $previousIndex is on top');
+        'onSwiperUndo The card $currentIndex was swiped back to the ${direction.name}. Now the card $previousIndex is on top');
 
     groupIndex.value = currentIndex;
     //   撤销之前左滑的操作
@@ -334,7 +335,7 @@ class PhotoPreviewController extends BaseController
     }
     selectedFileCount.value = selectedPhotosIds.length;
     updateSelectedFilesSize();
-    PhotoManager.clearFileCache();
+
 
     return true;
   }