onEvent method
Called whenever an event
is added
to any bloc
with the given bloc
and event
.
Implementation
@override
@mustCallSuper
void onEvent(Bloc bloc, Object? event) {
super.onEvent(bloc, event);
if (!settings.enabled || !settings.printEvents) {
return;
}
final accepted = settings.eventFilter?.call(bloc, event) ?? true;
if (!accepted) {
return;
}
_talker.logCustom(
BlocEventLog(
bloc: bloc,
event: event,
settings: settings,
),
);
}