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:
Project with "stronger" static analysis:
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