avoid_types_on_closure_parameters

Group: style

Maturity: stable

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

effective_dart

View the Project on GitHub dart-lang/linter

AVOID annotating types for function expression parameters.

Annotating types for function expression parameters is usually unnecessary because the parameter types can almost always be inferred from the context, thus making the practice redundant.

BAD:

var names = people.map((Person person) => person.name);

GOOD:

var names = people.map((person) => person.name);