CoursesHomeCubit class

A tela inicial: a seção, os cursos, o rascunho e a fila dos pacotes recebidos.

Inheritance

Constructors

CoursesHomeCubit({required Future<List<LoadedCourse>> carregarCursos(), required CourseProgressCubit progressoDoRascunho(CourseDraftCubit rascunho), int abaDosCursos = 1})

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<LoadedCourse>> Function()
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 error which 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 state to the provided state. emit does nothing if the state being emitted is equal to the current state.
inherited
enfileirar(IncomingPackage pacote) → bool
Põe o pacote na fila. Devolve true se nenhuma drenagem está em curso: quem chamou tem de começá-la.
marcarProntoParaReceber() → void
Chamado depois de um await da 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 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
recarregarCursos() → Future<void>
Recarrega a lista (instalou, removeu, abriu rascunho). Uma falha deixa a lista vazia, como o FutureBuilder deixava.
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