linhaDosTons function

String? linhaDosTons(
  1. List<RoundResult> history,
  2. ExerciseSource source
)

O resumo dos tons do exercício (EX05), com uma parte por rodada transposta: "Dó ✓ · Sol ✓ · Ré 82%" (✓ quando a rodada passou). null sem tons.

Implementation

String? linhaDosTons(List<RoundResult> history, ExerciseSource source) {
  final parts = [
    for (final round in history)
      if (round.key case final key?)
        '${key.split(' ').first} '
            '${source.verdict([round]).roundPassed ? '✓' : '${round.percent}%'}',
  ];
  return parts.isEmpty ? null : parts.join(' · ');
}