onEvent method

  1. @override
void onEvent(
  1. Bloc bloc,
  2. Object? event
)

Called whenever an event is added to any bloc with the given bloc and event.

Implementation

@override
void onEvent(Bloc bloc, Object? event) {
  super.onEvent(bloc, event);
  if (onEventFunc != null) {
    onEventFunc!(bloc, event);
  }
  events.add(
    EventInfo(
      bloc: bloc.runtimeType.toString(),
      event: event.runtimeType.toString(),
      timestamp: DateTime.now(),
    ),
  );
}