-
-
Save AbbasHoseini/be9b17e9ec28c7bcc92264ea41b90afb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyBlocObserver extends BlocObserver { | |
@override | |
void onCreate(BlocBase bloc) { | |
super.onCreate(bloc); | |
print('onCreate -- ${bloc.runtimeType}'); | |
} | |
@override | |
void onEvent(Bloc bloc, Object? event) { | |
super.onEvent(bloc, event); | |
print('onEvent -- ${bloc.runtimeType}, $event'); | |
} | |
@override | |
void onChange(BlocBase bloc, Change change) { | |
super.onChange(bloc, change); | |
print('onChange -- ${bloc.runtimeType}, $change'); | |
} | |
@override | |
void onTransition(Bloc bloc, Transition transition) { | |
super.onTransition(bloc, transition); | |
print('onTransition -- ${bloc.runtimeType}, $transition'); | |
} | |
@override | |
void onError(BlocBase bloc, Object error, StackTrace stackTrace) { | |
print('onError -- ${bloc.runtimeType}, $error'); | |
super.onError(bloc, error, stackTrace); | |
} | |
@override | |
void onClose(BlocBase bloc) { | |
super.onClose(bloc); | |
print('onClose -- ${bloc.runtimeType}'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment