beatLabel function
- double beats
Rótulo do botão de beats tempos ("½", "1", "1½", "2", "3", "4", "6").
Implementation
String beatLabel(double beats) {
if ((beats - 0.5).abs() < 1e-9) return '½';
if ((beats - 1.5).abs() < 1e-9) return '1½';
if ((beats - 2.5).abs() < 1e-9) return '2½';
if ((beats - 3.5).abs() < 1e-9) return '3½';
if (beats == beats.roundToDouble()) return '${beats.round()}';
return '$beats';
}