Returns the average of the list by applying f to each element. Returns 0 if the list is empty.
f
0
double averageBy(num Function(T) f) => isEmpty ? 0 : sumBy(f) / length;