Home > Blockchain >  Dart/Flutter static analysis behaves differently in two different projects (IntelliJ)
Dart/Flutter static analysis behaves differently in two different projects (IntelliJ)

Time:11-03

I work on two different Flutter projects. One seems to have more strict checks than the other. How do I get the weaker-checks project to be as strict at the other? I tried adding analysis_options.yaml file together with installing analyzer and flutter_lints packages, but it does not seem to bring the expected results.

Project with "weaker" static analysis: Weaker check

Project with "stronger" static analysis: Stronger check

CodePudding user response:

Apparently changing the SDK version in pubspec.yaml gave the desired result. So apparently changing:

environment:
  sdk: ">=2.10.0 <3.3.0"

to

environment:
  sdk: ">=2.18.0 <3.3.0"

results in much more strict static analyzer.

Dart language evolution page describes changes in subsequent versions: https://dart.dev/guides/language/evolution

  • Related