CoursesHomeCubit class
A tela inicial: a seção, os cursos, o rascunho e a fila dos pacotes recebidos.
- Inheritance
-
- Object
- BlocBase<
CoursesHomeState> - Cubit<
CoursesHomeState> - CoursesHomeCubit
Constructors
-
CoursesHomeCubit({required Future<
List< carregarCursos(), required CourseProgressCubit progressoDoRascunho(CourseDraftCubit rascunho), int abaDosCursos = 1})LoadedCourse> >
Properties
- abaDosCursos → int
-
A posição da seção Cursos na barra: 1 no aprendizado (Treinos é 0); 2 no
professor (Alunos é 0, TC12).
final
-
carregarCursos
→ Future<
List< Function()LoadedCourse> > -
De onde vêm os cursos (o embutido e os instalados); o State passa o dele.
final
-
cursosCarregados
→ Future<
void> -
A carga mais recente, para quem espera a lista (a drenagem dos pacotes).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the bloc is closed.
no setterinherited
- progressoDoRascunho → CourseProgressCubit Function(CourseDraftCubit rascunho)
-
O progresso que a lista usa enquanto há rascunho (o dele e o do disco).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → CoursesHomeState
-
The current state.
no setterinherited
-
stream
→ Stream<
CoursesHomeState> -
The current stream of states.
no setterinherited
- temPacotes → bool
-
no setter
Methods
-
addError(
Object error, [StackTrace? stackTrace]) → void -
Reports an
errorwhich triggers onError with an optional StackTrace.inherited -
adotarRascunho(
CourseDraftCubit rascunho) → void - O rascunho novo entra na lista (no topo) e a seção vai para Cursos. O rascunho e o progresso anteriores fecham.
-
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
-
comecarDrenagem(
) → void -
emit(
CoursesHomeState state) → void -
Updates the
stateto the providedstate. emit does nothing if thestatebeing emitted is equal to the currentstate.inherited -
enfileirar(
IncomingPackage pacote) → bool -
Põe o pacote na fila. Devolve
truese nenhuma drenagem está em curso: quem chamou tem de começá-la. -
marcarProntoParaReceber(
) → void -
Chamado depois de um
awaitda drenagem: a tela pode ter fechado nesse meio tempo. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
Change< CoursesHomeState> 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 -
recarregarCursos(
) → Future< void> -
Recarrega a lista (instalou, removeu, abriu rascunho). Uma falha deixa a lista
vazia, como o
FutureBuilderdeixava. -
selecionarAba(
int aba) → void -
terminarDrenagem(
) → void - Fim da drenagem: pode acabar depois de a tela fechar.
-
tirarProximo(
) → IncomingPackage - Tira da frente da fila o próximo pacote. A fila tem de ter algum.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited