Group: style
Maturity: stable
Dart SDK: >= 2.3.0 • (Linter v0.1.85)
Since info is static, may be staleWhen building collections, it is preferable to use if
elements rather than
conditionals.
BAD:
var list = ['a', 'b', condition ? 'c' : null].where((e) => e != null).toList();
GOOD:
var list = ['a', 'b', if (condition) 'c'];