fix: asset_viewer page viewing experience (#20889)

* fix: zoomed in effect on swiped when bottom sheet is open

* fix: memory leaked

* fix: asset out of range when swiping in asset_viewer
This commit is contained in:
Alex 2025-08-13 11:35:42 -05:00 committed by GitHub
parent b3fb831994
commit aefa62b234
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 126 additions and 43 deletions

View file

@ -86,6 +86,7 @@ class _ImageWrapperState extends State<ImageWrapper> {
Size? _imageSize;
Object? _lastException;
StackTrace? _lastStack;
bool _didLoadSynchronously = false;
@override
void dispose() {
@ -130,9 +131,11 @@ class _ImageWrapperState extends State<ImageWrapper> {
_loadingProgress = null;
_lastException = null;
_lastStack = null;
_didLoadSynchronously = synchronousCall;
}
synchronousCall ? setupCB() : setState(setupCB);
synchronousCall && !_didLoadSynchronously ? setupCB() : setState(setupCB);
}
void handleError(dynamic error, StackTrace? stackTrace) {