averageWith method Null safety
Calculates the average for the provided number using the previous
value and the count
of items
Implementation
double averageWith({
required num previous,
required int count,
}) {
final currentTotal = (previous * (count - 1)) + this;
final average = (currentTotal / count).to2Dp;
return double.parse(average);
}