wholeLevel property
O menor nível M (1 a 5) em que todos os trechos servem (a música inteira); null se algum trecho nunca serve, ou se não há trecho.
Implementation
int? get wholeLevel {
if (sections.isEmpty) return null;
for (var level = 1; level <= kMusicLevels; level++) {
final all = sections.every(
(section) => section.byLevel[level]?.passed ?? false,
);
if (all) return level;
}
return null;
}