DevBlocObserver class
A BlocObserver that records every Bloc/Cubit state change for the App
State Inspector. Set Bloc.observer = DevBlocObserver() before creating
any Bloc/Cubit.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
BlocBase bloc, Change change) → void - Records the transition, then chains to the superclass.
-
onClose(
BlocBase bloc) → void -
Called whenever a
Blocis closed.onCloseis called just before theBlocis closed and indicates that the particular instance will no longer emit new states.inherited -
onCreate(
BlocBase bloc) → void -
Called whenever a
Blocis instantiated. In many cases, a cubit may be lazily instantiated andonCreatecan be used to observe exactly when the cubit instance is created.inherited -
onDone(
Bloc bloc, Object? event, [Object? error, StackTrace? stackTrace]) → void -
Called whenever an
eventhandler for a specificblochas completed. This may include anerrorandstackTraceif an uncaught exception occurred within the event handler.inherited -
onError(
BlocBase bloc, Object error, StackTrace stackTrace) → void -
Called whenever an
erroris thrown in anyBlocorCubit. ThestackTraceargument may be StackTrace.empty if an error was received without a stack trace.inherited -
onEvent(
Bloc bloc, Object? event) → void -
Called whenever an
eventisaddedto anyblocwith the givenblocandevent.inherited -
onTransition(
Bloc bloc, Transition transition) → void -
Called whenever a transition occurs in any
blocwith the givenblocandtransition. Atransitionoccurs when a neweventis added and a new state isemittedfrom a correspondingEventHandler.onTransitionis called before abloc's state has been updated.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
entries
→ List<
BlocStateEntry> -
Recorded transitions, oldest first, capped at maxEntries.
no setter
-
version
→ ValueNotifier<
int> -
Bumped on every recorded change so the inspector can rebuild live.
final
Static Methods
-
clear(
) → void - Discards every recorded transition.
Constants
- maxEntries → const int
- Maximum transitions retained in memory. Oldest entries are dropped first, matching the behaviour of the other toolkit stores.