I'm getting this lint when using forEach
:
Avoid using `forEach` with a function literal.
This a sample code:
class AB {
int data;
AB(this.data);
int call() => data;
}
void main() {
var myList = [AB(1), AB(3)];
myList.forEach((e) => print(e())); // <--- lint raised here
}