foldTotal method

double foldTotal(
  1. double? builder(
    1. T e
    ), {
  2. double initial = 0,
})

Implementation

double foldTotal(
  double? Function(T e) builder, {
  double initial = 0,
}) {
  return fold<double>(initial, (prev, e) {
    final double? value = builder(e);
    if (value != null) return prev + value;
    return prev;
  });
}