TrainingPreviewCubit class
A prévia de um passo: sorteia um exemplo com o gerador do treino, desenha a partitura (se o passo tem) e toca. Não conta como rodada.
- Inheritance
-
- Object
- BlocBase<
TrainingPreviewState> - Cubit<
TrainingPreviewState> - TrainingPreviewCubit
Constructors
- TrainingPreviewCubit({required SightTrack track, required TrainingStep step, required CourseScreenDeps deps, int? seed})
Properties
- controller → ScoreCubit?
-
O controle de notas da partitura de agora (a tela o passa à
ScoreView).no setter - deps → CourseScreenDeps
-
Som e partitura da prévia (o mesmo que os cursos). O relógio da prévia é o
deps.clock(CT05e): a duração do "tocar" é contada nele.final - hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the bloc is closed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → TrainingPreviewState
-
The current state.
no setterinherited
- step → TrainingStep
-
final
-
stream
→ Stream<
TrainingPreviewState> -
The current stream of states.
no setterinherited
- track → SightTrack
-
O treino e o passo desta prévia.
final
- viewController → ScoreViewCubit?
-
O controle de página da partitura de agora.
no setter
Methods
-
addError(
Object error, [StackTrace? stackTrace]) → void -
Reports an
errorwhich triggers onError with an optional StackTrace.inherited -
another(
double largura) → Future< void> - Sorteia outro exemplo do passo e o toca (a partitura some até o novo desenho, e os controles de antes são fechados).
-
close(
) → Future< void> -
Closes the instance.
This method should be called when the instance is no longer needed.
Once close is called, the instance can no longer be used.
override
-
emit(
TrainingPreviewState state) → void -
Updates the
stateto the providedstate. emit does nothing if thestatebeing emitted is equal to the currentstate.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
Change< TrainingPreviewState> 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 -
play(
) → Future< void> - Toca o exemplo de agora. O motor de som abre só na primeira vez.
-
start(
double largura) → void -
Começa a prévia: desenha e toca o primeiro exemplo, depois do primeiro
quadro (o desenho precisa da largura da tela,
largura). -
stop(
) → void - Para o que toca (e as notas que ficaram presas).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited