findBiggest method

Widget findBiggest(
  1. List<Score> scores, {
  2. int? max,
})

finds the biggest value in a list of scores

Implementation

Widget findBiggest(List<Score> scores, {int? max}) {
  return For(
      to: scores.length - 1,
      create: (int i) {
        var ret = setToBiggest(scores[i]);
        if (max != null) {
          return If(
            scores[i].matchesRange(
              Range.to(max),
            ),
            then: [ret],
          );
        }
        return ret;
      });
}