StateMachine class

Finite State Machine.

Exposes a concise API to create and transition in a state machine and also to query it's current values.

Available Extensions

Constructors

StateMachine.create(void builder(StateNode<AutomataState>), {String? id, OnTransitionCallback? onTransition})
Creates a StateMachine using a builder pattern.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id String?
Machine identifier.
getter/setter pair
onTransition OnTransitionCallback?
The OnTransitionCallback will be called on every state transition the StateMachine performs.
getter/setter pair
rootNode ↔ StateNodeDefinition<RootState>
Root node of the StateMachine.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<StateMachineValue>
no setter
value StateMachineValue
Hold all the currently active StateNodeDefinition.
getter/setter pair

Methods

dispose() → void
Dipose StreamController.
isInState(Type type) bool
Check if the state machine is currently in a given AutomataState.
matchesStatePath(List<Type> path) bool
Check if the state machine contains a value that partially matches the given path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send<E extends AutomataEvent>(E event) → void
Send an event to the state machine.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited