Group: style
Maturity: experimental
Dart SDK: >= 2.12.0 • (Linter v0.1.119)
Since info is static, may be staleDON'T apply a null check when a nullable value is accepted.
BAD:
f(int? i) {}
m() {
int? j;
f(j!);
}
GOOD:
f(int? i) {}
m() {
int? j;
f(j);
}
To enable the unnecessary_null_checks
lint,
add unnecessary_null_checks
under linter > rules in your
analysis_options.yaml
file:
linter:
rules:
- unnecessary_null_checks