tree_state_machine library

Provides support for executing hierarchical state machines.

Classes

CurrentState
Describes the current leaf state of a TreeStateMachine.
DataValue<T>
Provides access to a data value of type T associated with a data state.
FailedMessage
A ProcessedMessage indicating an error was thrown while processing a message.
HandledMessage
A ProcessedMessage indicating that a state successfully handled a message.
MessageContext
Provides information to a state about the message that is being processed.
MessageResult
Base class for describing the results of processing a state machine message.
NestedMachine
Describes the initial state machine of a StateTreeBuilder.machineState.
NestedMachineData
State data for a nested state machine state.
NestedTreeStateMachineDoneMessage
The message that is sent to a state machine when a nested state machine has reached a final state.
ProcessedMessage
Base class for types describing how a message was processed by a state machine.
StateDataCodec<D>
StateKey
A StateKey is an indentifier for a state within a tree state machine.
Transition
Describes a transition between states.
TransitionContext
Describes a transition between states that is occuring in a tree state machine.
TreeStateMachine
A state machine that manages transitions among the states in a state tree.
UnhandledMessage
A ProcessedMessage indicating that none of the active states in the state machine recognized the message.

Enums

LifecycleState
Enumerates the lifecycle of a TreeStateMachine.
PostMessageErrorPolicy
Describes how the future returned by CurrentState.post behaves when an error occurs when a state processes the posted message.

Properties

stoppedStateKey StateKey
Identifies the stopped state in a state tree.
final

Functions

emptyDispose() → void
A dispose function that does nothing
emptyMessageHandler(MessageContext msgCtx) FutureOr<MessageResult>
A MessageHandler that always returns MessageContext.unhandled.
emptyTransitionAction(TransitionContext ctx) FutureOr<void>
A transition action that does nothing.
emptyTransitionHandler(TransitionContext transCtx) FutureOr<void>
A TransitionHandler that returns immediately.

Typedefs

Dispose = void Function()
Type of functions that are used to signal that resources can be released.
GetInitialChild = StateKey Function(TransitionContext ctx)
Type of functions that select a child state to initially enter, when a parent state is entered.
MessageHandler = FutureOr<MessageResult> Function(MessageContext ctx)
Type of functions that process messages sent to a state machine.
TransitionAction = FutureOr<void> Function(TransitionContext ctx)
Type of functions that can apply side-effects as transitions occcur.
TransitionHandler = FutureOr<void> Function(TransitionContext ctx)
Type of functions that are called when a state transition occurs within a state machine.