onExit method

void onExit(
  1. VoidCallback handler
)

Registers a callback invoked when exiting this state type, but only if the next state is not also of type TDerived.

Implementation

void onExit(VoidCallback handler) {
  _internalState.onExit<TDerived>((_) => handler());
}