Sets callback that will be called right before machine exits this State.
void onExit(OnExit onExit, {String? label}) { _stateDefinition ..onExit = onExit ..onExitLabel = label; }