Fix view exceptions in the new viewer

This commit is contained in:
Ming Ming 2024-10-08 01:45:39 +08:00
parent 3576f7e397
commit 03015e999e
2 changed files with 5 additions and 4 deletions

View file

@ -163,7 +163,7 @@ class _PageViewState extends State<_PageView> {
}); });
} else { } else {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted) { if (mounted && _scrollController.hasClients) {
_scrollController.jumpTo(0); _scrollController.jumpTo(0);
} }
}); });

View file

@ -87,9 +87,10 @@ class _ZoomableViewerState extends State<ZoomableViewer>
} }
void _setIsZooming(bool flag) { void _setIsZooming(bool flag) {
setState(() { _isZooming = flag;
_isZooming = flag; if (mounted) {
}); setState(() {});
}
final next = _isZoomed; final next = _isZoomed;
if (next != _wasZoomed) { if (next != _wasZoomed) {
_wasZoomed = next; _wasZoomed = next;