sumBy method

int sumBy(
  1. int judgeFunc(
    1. T element
    )
)

Implementation

int sumBy(int Function(T element) judgeFunc) {
  int sum = 0;
  forEach((element) {
    sum += judgeFunc(element);
  });
  return sum;
}