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 (event == null) return;
  log('\x1B[32m${bloc.runtimeType}.add(${event.runtimeType})');
  final Object? state = bloc.state;
  if (state == null) return;
}