Skip to content
This repository has been 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
asaarnak opened this issue Jan 5, 2023 · 2 comments · Fixed by #1136
Closed

[BUG] use-setstate-synchronously with switch cases and exception on handling. #1133

asaarnak opened this issue Jan 5, 2023 · 2 comments · Fixed by #1136
Assignees
Labels
area-rules type: bug Something isn't working
Milestone

Comments

@asaarnak
Copy link

asaarnak commented Jan 5, 2023

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;
    }
@incendial incendial added type: bug Something isn't working area-rules labels Jan 5, 2023
@incendial
Copy link
Member

@Desdaemon hi, do you want to take a look?

@incendial incendial reopened this Jan 6, 2023
@incendial incendial added the waiting for release Will be available after new version is released label Jan 6, 2023
@incendial incendial added this to the 5.5.0 milestone Jan 10, 2023
@incendial
Copy link
Member

Fixed in 5.5.0 🚀

@incendial incendial removed the waiting for release Will be available after new version is released label Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-rules type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants