onTransition method

void onTransition(
  1. Transition<Event, State> transition

Called whenever a transition occurs with the given transition. A transition occurs when a new event is added and mapEventToState executed. onTransition is called before a bloc's state has been updated. A great spot to add logging/analytics at the individual bloc level.


void onTransition(Transition<Event, State> transition) => null;