added mounted check before setting state in choice_array

This commit is contained in:
ggurdin 2024-10-23 10:12:40 -04:00
parent 5d190cc51e
commit 3efe374302
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -44,17 +44,13 @@ class ChoicesArrayState extends State<ChoicesArray> {
void disableInteraction() {
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
interactionDisabled = true;
});
if (mounted) setState(() => interactionDisabled = true);
});
}
void enableInteractions() {
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
interactionDisabled = false;
});
if (mounted) setState(() => interactionDisabled = false);
});
}