Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positives for signals_avoid_create_in_build_method #304

Open
Lootwig opened this issue Aug 24, 2024 · 2 comments
Open

False positives for signals_avoid_create_in_build_method #304

Lootwig opened this issue Aug 24, 2024 · 2 comments

Comments

@Lootwig
Copy link
Contributor

Lootwig commented Aug 24, 2024

class ClassWithALongName {
  static final iDoNotWantThisSignalNameToAppearEverywhere = SetSignal({1, 2, 3});
}

class FalsePositive extends StatelessWidget {
  const FalsePositive({super.key});

  @override
  Widget build(BuildContext context) {
    // this gets flagged, even though it is merely a read access on the existing one
    final shorthand = ClassWithALongName.iDoNotWantThisSignalNameToAppearEverywhere;
    if (shorthand.isNotEmpty) {
      return const Placeholder();
    } else if (shorthand.first.isOdd) {
      return const SizedBox();
    } else {
      return Text(shorthand.where((_) => true).toString());
    }
  }
}
@rodydavis
Copy link
Owner

Still learning how to best right the lint rules, but will try to update it for this 👍🏼

@Lootwig
Copy link
Contributor Author

Lootwig commented Aug 26, 2024

Started working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants