reduceOrNull method
E?
reduceOrNull(
- E combine(
- E value,
- E element
Accumulates value starting with the first element and applying combine
function from left to right to current accumulator value and each element.
Implementation
E? reduceOrNull(E Function(E value, E element) combine) {
if (isEmpty) return null;
final iterator = this.iterator..moveNext();
E value = iterator.current;
while (iterator.moveNext()) {
value = combine(value, iterator.current);
}
return value;
}