enterChannel<P> method

void enterChannel<P>(
  1. Channel<P> channel,
  2. FutureOr<P> payload(
    1. MessageHandlerContext<Object, NestedMachineData, C>
    ), {
  3. MessageActionDescriptor<Object, NestedMachineData, C>? action,
  4. bool reenterTarget = false,
})
inherited

Indicates that channel should be entered and a transition to the channels state should occur.

The payload function wull be called to obtain the payload for the channel when the transition occurs.

If action is provided, this action will be invoked before the transition occurs. The MessageHandlerBuilder.act builder can be used to specify this action.

If reenterTarget is true, then the target state will be re-entered (that is, its exit and entry handlers will be called), even if the state is already active.

Implementation

void enterChannel<P>(
  Channel<P> channel,
  FutureOr<P> Function(MessageHandlerContext<M, D, C>) payload, {
  MessageActionDescriptor<M, D, C>? action,
  bool reenterTarget = false,
}) {
  goTo(channel.to, payload: payload, reenterTarget: reenterTarget, action: action);
}