cumulativeSum method
- bool treatNullsAsZeros = true,
Returns ListtreatNullsAsZeros being set to true will lead to the the result being of
the same length as the original column. Otherwise, null records won't be
accounted for.
Note: requires column records type to be a subtype of <num?>
Implementation
List<num> cumulativeSum({bool treatNullsAsZeros = true}) =>
_nullFreedNums(treatNullsAsZeros: treatNullsAsZeros).fold(
[],
(sums, element) =>
sums..add(sums.isEmpty ? element : sums.last + element));