averageAsync method

Future<double> averageAsync()

Calculates the average of all values. This only works for numeric values.

Implementation

Future<double> averageAsync() => aggregateAsync<double>(Aggregation.average)
    .then((value) => value ?? double.nan);