avoid_function_literals_in_foreach_calls

Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.30)

View the Project on GitHub dart-lang/linter

AVOID using forEach with a function literal.

BAD:

people.forEach((person) {
  ...
});

GOOD:

for (var person in people) {
  ...
}

people.forEach(print);