fix: guard lifecycle-bound state updates
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user