diff --git a/lib/src/photo_view_wrappers.dart b/lib/src/photo_view_wrappers.dart index 7c1cb39..4cfbbc9 100644 --- a/lib/src/photo_view_wrappers.dart +++ b/lib/src/photo_view_wrappers.dart @@ -114,6 +114,12 @@ class _ImageWrapperState extends State { } void handleImageFrame(ImageInfo info, bool synchronousCall) { + if (_imageSize != null && _imageStream == null) { + _stopImageStream(); + _imageStream = null; + return; + } + final setupCB = () { _imageSize = Size( info.image.width.toDouble(), @@ -125,6 +131,9 @@ class _ImageWrapperState extends State { _loadingProgress = null; _lastException = null; _lastStack = null; + + _stopImageStream(); + _imageStream = null; }; synchronousCall ? setupCB() : setState(setupCB); }