Pattern: Missing use of inlined list item declaration
Issue: -
Declare elements in list literals inline, rather than using add
and addAll
methods where possible.
Example of incorrect code:
var l = ['a']..add('b')..add('c');
var l2 = ['a']..addAll(['b', 'c'])
Example of correct code:
var l = ['a', 'b', 'c'];
var 2 = ['a', 'b', 'c'];