repeatWorstChart method

void repeatWorstChart(
  1. Set<int> bars
)

"Repetir os compassos difíceis": uma rodada nova só com os compassos que tiveram erro, que não conta para o passe.

Implementation

void repeatWorstChart(Set<int> bars) {
  final round = state.chart.round;
  if (round == null || round.repeatBars == null) return;
  final next = round.repeatBars!(bars);
  // Um pedido novo, como em `novaRodada`: o que ainda carregava desiste.
  final token = ++_roundToken;
  _soltarRodada();
  // A grade velha já tem o executor fechado: a tela mostra a carga até a nova.
  _emitir(
    state.copyWith(
      loading: true,
      courseUse: null,
      chart: ExerciseChartState.vazio,
    ),
  );
  unawaited(
    _montarGrade(
      next,
      practice: true,
      stale: () => !_vivo || token != _roundToken,
    ),
  );
}