sightListenQuestion function

Question sightListenQuestion(
  1. SightStep step,
  2. int seed, [
  3. SightListenOptions options = const SightListenOptions()
])

A pergunta de ouvido sobre a partitura de step sorteada com seed. A partitura é a mesma que o treino de leitura monta com essa semente. Se a semente não der uma mudança que caiba, a próxima tenta.

Implementation

Question sightListenQuestion(
  SightStep step,
  int seed, [
  SightListenOptions options = const SightListenOptions(),
]) {
  final listen = _ListenAttempts(step, options);
  for (var attempt = 0; attempt < 50; attempt++) {
    final question = listen.attempt(seed + attempt);
    if (question != null) return question;
  }
  throw StateError('nenhuma mudança cabe no passo ${step.name}');
}