onTransition method

  1. @override
void onTransition(
  1. Bloc bloc,
  2. Transition transition
)
override

Called whenever a transition occurs in any bloc with the given bloc and transition. A transition occurs when a new event is added and a new state is emitted from a corresponding EventHandler. onTransition is called before a bloc's state has been updated.

Implementation

@override
void onTransition(
  Bloc<dynamic, dynamic> bloc,
  Transition<dynamic, dynamic> transition,
) {
  for (final observer in observers) {
    observer.onTransition(bloc, transition);
  }
}