InitialMachine.fromTree constructor
InitialMachine.fromTree(
- FutureOr<
StateTreeBuilder> create(- TransitionContext transCtx
- String? label,
- String? logName,
Constructs an InitialMachine that will create and start a nested state machine using
the StateTreeBuilder produced by the create function.
Implementation
factory InitialMachine.fromTree(
FutureOr<StateTreeBuilder> Function(TransitionContext transCtx) create, {
String? label,
String? logName,
}) {
return InitialMachine._(
(ctx) {
return create(ctx).bind((treeBuilder) {
return TreeStateMachine(treeBuilder, logName: logName);
});
},
true,
true,
label,
);
}