Dart Analyze logoDart Analyze/
DRT-W1071

Avoid annotating types for function expression parametersDRT-W1071

Major severityMajor
Anti-pattern categoryAnti-pattern

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);