CourseDraftCubit class
Uma pasta aberta como rascunho: o último readCourse mais o progresso da
sessão (que o Recarregar mantém) e a lição selecionada (idem, se ela
ainda existir).
- Inheritance
-
- Object
- BlocBase<
CourseDraftState> - Cubit<
CourseDraftState> - CourseDraftCubit
Constructors
-
CourseDraftCubit({required Future<
CourseFiles> loadFiles(), MemoryCourseProgressCubit? progress})
Properties
- course → Course?
-
no setter
-
errors
→ List<
CourseIssue> -
no setter
- files → CourseFiles?
-
no setter
- hasErrors → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the bloc is closed.
no setterinherited
-
issues
→ List<
CourseIssue> -
no setter
- label → String
-
Nome para a faixa ("Rascunho · não verificado ·
no setter
- lessonId → String?
-
A lição aberta (para o Recarregar manter a tela, se ela ainda existir).
no setter
- loaded → LoadedCourse?
-
O curso pronto para as telas do I09, com
origin: draft.nullcom erro (aí vale a lista de problemas).no setter - loading → bool
-
no setter
- progress → MemoryCourseProgressCubit
-
Progresso da sessão: o mesmo objeto do primeiro ao último Recarregar.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → CourseDraftState
-
The current state.
no setterinherited
-
stream
→ Stream<
CourseDraftState> -
The current stream of states.
no setterinherited
-
warnings
→ List<
CourseIssue> -
no setter
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
-
emit(
CourseDraftState 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< CourseDraftState> 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 -
reload(
) → Future< void> -
Lê de novo e atualiza: o progresso da sessão fica, a lição fica se ela
ainda existir no curso novo (senão volta para
null, a lista). -
selectLesson(
String? id) → void -
A lição que a tela mostra (a selecionada, se ainda existir).
nullvolta para a lista, por isso o estado é montado inteiro (ocopyWithnão limpa). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited