fix: guard lifecycle-bound state updates

This commit is contained in:
edde746
2026-07-12 19:00:28 +02:00
parent 2101f1d7f0
commit 917f6a2839
5 changed files with 44 additions and 31 deletions
@@ -63,6 +63,7 @@ class _AtmosDiagnosticsScreenState extends State<AtmosDiagnosticsScreen> {
}
try {
await _channel.invokeMethod('start', {'mode': mode, if (needsUrl) 'url': url});
if (!mounted) return;
setState(() => _activeMode = mode);
} on PlatformException catch (e) {
if (mounted) showErrorSnackBar(context, e.message ?? e.code);