onEnter method

void onEnter(
  1. VoidCallback handler
)

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

Implementation

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