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