InitialMachine.fromMachine constructor

InitialMachine.fromMachine(
  1. FutureOr<TreeStateMachine> create(
    1. TransitionContext
    ), {
  2. bool disposeOnExit = true,
  3. bool forwardMessages = true,
  4. String? label,
})

Constructs an InitialMachine that will use the state machine produced by the create function as the nested state machine.

If disposeOnExit is true (the default), then the nested state machine will be disposed when the StateTreeBuilder.machineState is exited.

If forwardMessages is true (the default), then the StateTreeBuilder.machineState will forward any messages that are dispatched to it to the nested state machine.

Implementation

factory InitialMachine.fromMachine(
  FutureOr<TreeStateMachine> Function(TransitionContext) create, {
  bool disposeOnExit = true,
  bool forwardMessages = true,
  String? label,
}) {
  return InitialMachine._(create, disposeOnExit, forwardMessages, label);
}