Explorar o código

Check if widget is mounted before precaching image

Vishnu Mohandas %!s(int64=5) %!d(string=hai) anos
pai
achega
25de85aea6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/ui/zoomable_image.dart

+ 1 - 1
lib/ui/zoomable_image.dart

@@ -168,7 +168,7 @@ class _ZoomableImageState extends State<ZoomableImage>
 
   void _onLargeThumbnailLoaded(
       ImageProvider imageProvider, BuildContext context) {
-    if (!_loadedFinalImage) {
+    if (mounted && !_loadedFinalImage) {
       precacheImage(imageProvider, context).then((value) {
         if (mounted) {
           setState(() {