Skip to content
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
@asaarnak

Description

@asaarnak

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;
    }

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions