Skip to content

Commit

Permalink
remove enableMemoryCache (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
Passer-by authored Jan 3, 2025
1 parent 7d1c950 commit 63684b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

* Removed the `enableMemoryCache` variable in `ExtendedImage`,please Use `clearMemoryCacheWhenDispose` instead for managing memory cache behavior.

## 9.0.9

* Fix drag crop rect can't zoom in the image(#723)
Expand Down
13 changes: 0 additions & 13 deletions lib/src/extended_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ExtendedImage extends StatefulWidget {
this.beforePaintImage,
this.afterPaintImage,
this.mode = ExtendedImageMode.none,
this.enableMemoryCache = true,
this.clearMemoryCacheIfFailed = true,
this.onDoubleTap,
this.initGestureConfigHandler,
Expand Down Expand Up @@ -220,7 +219,6 @@ class ExtendedImage extends StatefulWidget {
this.beforePaintImage,
this.afterPaintImage,
this.mode = ExtendedImageMode.none,
this.enableMemoryCache = true,
this.clearMemoryCacheIfFailed = true,
this.onDoubleTap,
this.initGestureConfigHandler,
Expand Down Expand Up @@ -317,7 +315,6 @@ class ExtendedImage extends StatefulWidget {
this.beforePaintImage,
this.afterPaintImage,
this.mode = ExtendedImageMode.none,
this.enableMemoryCache = true,
this.clearMemoryCacheIfFailed = true,
this.onDoubleTap,
this.initGestureConfigHandler,
Expand Down Expand Up @@ -408,7 +405,6 @@ class ExtendedImage extends StatefulWidget {
this.beforePaintImage,
this.afterPaintImage,
this.mode = ExtendedImageMode.none,
this.enableMemoryCache = true,
this.clearMemoryCacheIfFailed = true,
this.onDoubleTap,
this.initGestureConfigHandler,
Expand Down Expand Up @@ -476,7 +472,6 @@ class ExtendedImage extends StatefulWidget {
this.beforePaintImage,
this.afterPaintImage,
this.mode = ExtendedImageMode.none,
this.enableMemoryCache = true,
this.clearMemoryCacheIfFailed = true,
this.onDoubleTap,
this.initGestureConfigHandler,
Expand Down Expand Up @@ -568,9 +563,6 @@ class ExtendedImage extends StatefulWidget {
///call back of double tap under ExtendedImageMode.gesture
final DoubleTap? onDoubleTap;

///whether cache in PaintingBinding.instance.imageCache
final bool enableMemoryCache;

///when failed to load image, whether clear memory cache
///if true, image will reload in next time.
final bool clearMemoryCacheIfFailed;
Expand Down Expand Up @@ -1213,11 +1205,6 @@ class _ExtendedImageState extends State<ExtendedImage>
_frameNumber = _frameNumber == null ? 0 : _frameNumber! + 1;
_wasSynchronouslyLoaded = _wasSynchronouslyLoaded | synchronousCall;
});

// clearMemoryCacheWhenDispose is better
// if (!widget.enableMemoryCache) {
// widget.image.evict();
// }
}

void _listenToStream() {
Expand Down

0 comments on commit 63684b1

Please sign in to comment.