sumOf<T> function
Utility function to sum up values in a list.
Implementation
double sumOf<T>(List<T> list, double? Function(T elt) getValue) {
var sum = 0.0;
for (var elt in list) {
sum += getValue(elt)!;
}
return sum;
}