ChartScoreCubit class

Desenha a partitura da rodada e guarda o controlador dela (ScoreCubit) e a vista (ScoreViewCubit), que o ScoreView usa.

Inheritance

Constructors

ChartScoreCubit({required ChartScoreSource source, required ScoreRenderer rendererFactory(), required bool scoreCursor})

Properties

hashCode → int
The hash code for this object.
no setterinherited
isClosed → bool
Whether the bloc is closed.
no setterinherited
rendererFactory → ScoreRenderer Function()
O renderizador da partitura (o da plataforma; os testes trocam).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
score → ScoreCubit?
O controlador da partitura desenhada, ou null enquanto desenha.
no setter
scoreCursor → bool
A rodada tem o cursor do compasso (EX13): só então os compassos se guardam.
final
source → ChartScoreSource
final
state → ChartScoreState
The current state.
no setterinherited
stream → Stream<ChartScoreState>
The current stream of states.
no setterinherited
view → ScoreViewCubit
A vista do ScoreView; fecha junto com este Cubit.
final

Methods

addError(Object error, [StackTrace? stackTrace]) → void
Reports an error which triggers onError with an optional StackTrace.
inherited
close() → Future<void>
Fecha a partitura e a vista. O super.close() vem antes das esperas: a partir dele, isClosed já vale e o desenho que termina não emite.
override
emit(ChartScoreState state) → void
Updates the state to the provided state. emit does nothing if the state being emitted is equal to the current state.
inherited
load() → Future<void>
Desenha a partitura pelo mesmo caminho da pergunta (lessonScoreLayout). Depois do close, não emite.
moverCursor(int bar) → void
O cursor da partitura: acende as notas do compasso bar (o que o aluno toca agora) e apaga as do anterior. Sem partitura desenhada, não faz nada.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChange(Change<ChartScoreState> change) → void
Called whenever a change occurs with the given change. A change occurs when a new state is emitted. onChange is called before the state of the cubit is updated. onChange is a great spot to add logging/analytics for a specific cubit.
inherited
onError(Object error, StackTrace stackTrace) → void
Called whenever an error occurs and notifies BlocObserver.onError.
inherited
pintarCompassos(RoundResult result) → void
No fim, cada compasso fica verde (sem erro) ou vermelho (com erro, pelo measureErrors do resultado). O cursor sai.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited