This repository was archived by the owner on Jul 16, 2023. It is now read-only.
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
[BUG] use-setstate-synchronously
with switch cases and exception on handling. #1133
Closed
Description
See comments in code examples
When using exception on handling.
} on FirstException {
if (!mounted) {
return;
}
setState(() {
});
} on SecondException {
// Missing analyzer warning here
setState(() {
});
}
When using switch case handling.
switch (enumStatus) {
case MyEnum.FIRST:
if (!mounted) {
return;
}
setState(() {
});
return;
case MyEnum.SECOND:
// Missing analyzer warning here
setState(() {
});
return;
}