onTransform method
Called whenever a transition
occurs with the given transition
.
A transition
occurs when a new event
is added and mapEventToState
executed.
onTransform is called before a Controller
's state has been updated.
A great spot to add logging/analytics at the individual Controller
level.
Note: super.onTransform
should always be called first.
@override
void onTransform(Transition<Event, State> transition) {
// Always call super.onTransform with the current transition
super.onTransform(transition);
// Custom onTransform logic goes here
}
See also:
ObserverController.onTransform
for observing transitions globally.
Implementation
@protected
@mustCallSuper
void onTransform(TransformController<Event, State> transition) {
// ignore: invalid_use_of_protected_member
Controller.observer.onTransform(this, transition);
}