From d96629a7f1461a5989755eeb1beec18c3ed4af86 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 7 Jan 2026 01:48:20 +0800 Subject: [PATCH] :bug: Fix universal image still got state changes after unmounted --- lib/widgets/content/image.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/widgets/content/image.dart b/lib/widgets/content/image.dart index d7698405..d911b2a1 100644 --- a/lib/widgets/content/image.dart +++ b/lib/widgets/content/image.dart @@ -75,7 +75,9 @@ class UniversalImage extends HookWidget { ); }, imageBuilder: (context, imageProvider) { - Future(() => loaded.value = true); + Future(() { + if (context.mounted) return loaded.value = true; + }); return AnimatedOpacity( opacity: loaded.value ? 1.0 : 0.0, duration: const Duration(milliseconds: 300),