findSmallest method

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

finds the smallest value in a list of scores

Implementation

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