SimpleOverlayBlocObserverLogger class
A custom BlocObserver that logs BLoC events, state changes, and errors
to the simple_logger_overlay system.
This observer writes logs into persistent storage using SimpleOverlayLogStorageService, and formats them as SimpleOverlayLog entries for display in the overlay.
Usage:
Bloc.observer = SimpleOverlayBlocObserverLogger();
- Inheritance
-
- Object
- BlocObserver
- SimpleOverlayBlocObserverLogger
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 -
Logs every state
changeas aninfo-level SimpleOverlayLog.override -
onClose(
BlocBase bloc) → void -
Called whenever a Bloc is closed.
onClose is called just before the Bloc is closed
and indicates that the particular instance will no longer
emit new states.
inherited
-
onCreate(
BlocBase bloc) → void -
Called whenever a Bloc is instantiated.
In many cases, a cubit may be lazily instantiated and
onCreate can be used to observe exactly when the cubit
instance is created.
inherited
-
onError(
BlocBase bloc, Object error, StackTrace stackTrace) → void -
Logs all
errors andstackTraces aserror-level SimpleOverlayLogs.override -
onEvent(
Bloc bloc, Object? event) → void -
Logs every dispatched BLoC
eventas adebug-level SimpleOverlayLog.override -
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 corresponding EventHandler. onTransition is 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