onExit method

void onExit(
  1. void doOnEnter(
    1. S,
    2. EVENT
    )
)

Implementation

void onExit(void Function(S, EVENT) doOnEnter) {
  _stateDefinition.onExitListeners
      .add((STATE state, EVENT cause) => doOnEnter.call(state as S, cause));
}