onExit method

void onExit(
  1. void callback(
    1. S
    )
)

Sets callback that will be called right before machine exits this state.

Implementation

void onExit(void Function(S) callback) {
  _stateDefinition.onExit = (STATE s) => callback(s as S);
}