ChartScoreCubit class
Desenha a partitura da rodada e guarda o controlador dela (ScoreCubit) e a
vista (ScoreViewCubit), que o ScoreView usa.
- Inheritance
-
- Object
- BlocBase<
ChartScoreState> - Cubit<
ChartScoreState> - ChartScoreCubit
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
nullenquanto 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
errorwhich 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,isClosedjá vale e o desenho que termina não emite.override -
emit(
ChartScoreState state) → void -
Updates the
stateto the providedstate. emit does nothing if thestatebeing emitted is equal to the currentstate.inherited -
load(
) → Future< void> -
Desenha a partitura pelo mesmo caminho da pergunta (
lessonScoreLayout). Depois doclose, 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
changeoccurs with the givenchange. Achangeoccurs when a newstateis emitted. onChange is called before thestateof thecubitis updated. onChange is a great spot to add logging/analytics for a specificcubit.inherited -
onError(
Object error, StackTrace stackTrace) → void -
Called whenever an
erroroccurs and notifies BlocObserver.onError.inherited -
pintarCompassos(
RoundResult result) → void -
No fim, cada compasso fica verde (sem erro) ou vermelho (com erro, pelo
measureErrorsdo resultado). O cursor sai. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited