StateTree class Getting Started State Trees
Defines a state tree that can be used in conjunction with a TreeStateMachine.
- Implemented types
Constructors
-
StateTree.new(InitialChild initialChild, {required List<
StateConfig> childStates, List<FinalStateConfig> finalStates = const [], String? logName}) -
Constructs a state tree that is is composed of the states in the list of
childStates
, and starts in the state identified by theinitialChild
.factory -
StateTree.root(StateKey rootKey, InitialChild initialChild, {TransitionHandler? onEnter, TransitionHandler? onExit, MessageHandler? onMessage, required List<
StateConfig> childStates, List<FinalStateConfig> finalStates = const [], List<TreeStateFilter> ? filters, String? logName}) -
Constructs a state tree with a root state identified by
rootKey
.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createRootNodeInfo(
) → RootNodeInfo -
Creates a RootNodeInfo that can be used by StateTreeBuilder to build a
state tree.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
dataRoot<
D> (DataStateKey< D> rootKey, InitialData<D> initialData, InitialChild initialChild, {TransitionHandler? onEnter, TransitionHandler? onExit, MessageHandler? onMessage, required List<StateConfig> childStates, List<FinalStateConfig> finalStates = const [], StateDataCodec<D> ? codec, List<TreeStateFilter> ? filters, String? logName}) → StateTree -
Constructs a state tree with a root data state identified by
rootKey
, starting with a state data value provided byinitialData
.