load method

Future<void> load(
  1. ScoreRound round, {
  2. double widthPx = kDefaultPaperWidthPx,
  3. double? heightPx,
  4. Map<String, Object?>? layoutOverrides,
})

Renderiza round e monta o treino, sem começar a tocar. widthPx é a largura da caixa da partitura em pixels do dispositivo e heightPx a altura, na mesma medida: a música que não cabe nela segue em outras páginas (lessonScoreLayout).

Implementation

Future<void> load(
  ScoreRound round, {
  double widthPx = kDefaultPaperWidthPx,
  double? heightPx,
  Map<String, Object?>? layoutOverrides,
}) async {
  _release();
  final document = await _renderRound(
    round,
    widthPx,
    heightPx,
    layoutOverrides,
  );
  if (_disposed) return;
  final timeline = ScoreTimeline(document);
  if (timeline.measures.isEmpty) {
    throw StateError('a partitura da rodada não tem compassos');
  }
  _mount(document, timeline, _withAppNotes(round, document));
}