🐛 Fix universal image still got state changes after unmounted

This commit is contained in:
2026-01-07 01:48:20 +08:00
parent 1b6ccccf32
commit d96629a7f1

View File

@@ -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),