TrainingsCubit class
A tela inicial dos treinos. Lê o progresso de todos os treinos ao abrir e de novo depois de cada treino (a tela chama load).
- Inheritance
-
- Object
- BlocBase<
TrainingsState> - Cubit<
TrainingsState> - TrainingsCubit
Constructors
- TrainingsCubit({required SightReadingStore store, required bool hasMusic, required AppBusy busy, MusicInviteStore? invite})
Properties
- busy → AppBusy
-
O trabalho do app (CT02/CT09): a leitura do progresso conta nele, para o
roteiro de capturas não andar o relógio enquanto ela não chega.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMusic → bool
-
Se a tela tem o
musicdos treinos. Sem ele, não há cartão da música e o convite não aparece.final - isClosed → bool
-
Whether the bloc is closed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → TrainingsState
-
The current state.
no setterinherited
- store → SightReadingStore
-
Onde o progresso dos treinos é lido e gravado.
final
-
stream
→ Stream<
TrainingsState> -
The current stream of states.
no setterinherited
Methods
-
addError(
Object error, [StackTrace? stackTrace]) → void -
Reports an
errorwhich triggers onError with an optional StackTrace.inherited -
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.
inherited
-
dismissInvite(
) → Future< void> - "Agora não" (ou "Experimentar"): esconde o convite e grava, para ele não voltar.
-
emit(
TrainingsState state) → void -
Updates the
stateto the providedstate. emit does nothing if thestatebeing emitted is equal to the currentstate.inherited -
load(
) → Future< void> - Lê o progresso de todos os treinos, o último aberto e se o convite aparece.
-
markLast(
SightTrack track) → void -
Marca
trackcomo o último aberto: o cartão "Continuar" e a gravação não esperam uma pela outra. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
Change< TrainingsState> 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 -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited