onExit method

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

Registers doOnExit, called whenever the machine leaves this state.

Implementation

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