sumByDouble method

double sumByDouble(
  1. num selector(
    1. T
    )
)

Returns the sum of all values produced by the selector function that is applied to each element.

Example:

[1.5, 2.5].sumByDouble((d) => 0.5 * d); // 2.0

Implementation

double sumByDouble(num Function(T) selector) {
  ArgumentError.checkNotNull(selector, 'selector');
  return map(selector).fold(0.0, (prev, curr) => prev + curr);
}