StateTreeBuilder constructor

StateTreeBuilder({
  1. required StateKey initialState,
})

Creates a StateTreeBuilder that will build a state tree that starts in the state identified by initialState.

The state tree has an implicit root state, identified by StateTreeBuilder.defaultRootKey. This state has no associated behavior, and it is typically safe to ignore its presence.

Implementation

factory StateTreeBuilder({required StateKey initialState}) {
  var b = StateTreeBuilder._(defaultRootKey);
  b.state(defaultRootKey, emptyState, initialChild: InitialChild(initialState));
  return b;
}