prefer_inlined_adds

Group: style

Maturity: stable

Linter v0.1.86

Since info is static, may be stale
recommendedflutterpedantic

View all Lint Rules

Using the Linter

Declare elements in list literals inline, rather than using add and addAll methods where possible.

BAD:

var l = ['a']..add('b')..add('c');
var l2 = ['a']..addAll(['b', 'c'])

GOOD:

var l = ['a', 'b', 'c'];
var 2 = ['a', 'b', 'c'];