automata library

Classes

AutomataEvent
Base class for all Events that you pass to the state machine.
AutomataState
Base class for all States that you pass to the state machine.
DoneInvokeEvent<Result>
AutomataEvent triggered an a InvokeSrcCallback is executed successfully.
ErrorEvent
Abstract AutomataEvent that serves as base class for every error triggerd by the state machine.
InitialEvent
AutomataEvent called when the StateMachine is first created to ensure the initial state is properly set.
NullEvent
Pseudo AutomataEvent used to trigger eventless transitions.
PlatformErrorEvent
Platform error event.
RootState
Pseudo AutomataState used as root of our state machine.
StateMachine
Finite State Machine.
StateMachineValue
Structure that olds the currently active StateNodeDefinition in a StateMachine.
StateNode<S extends AutomataState>
Represents a Node for a particular AutomataState in our StateMachine.

Enums

StateNodeType
Possible node types.

Extensions

StateMachineValidator on StateMachine
Extension on StateMachine to perform validations.
StateNodeDefinitionValidator on StateNodeDefinition<AutomataState>
Extension on StateNodeDefinition to perform validations.

Functions

exportToXStateViz(StateMachine machine, {bool writeToFile = true}) Future<String>
Generates a json representation of the given StateMachine to be used in Stately's XState Viz.

Typedefs

Action<E extends AutomataEvent> = void Function(E event)
A function called when a transition is applied.
GuardCondition<E extends AutomataEvent> = bool Function(E event)
A function used to allow / deny execution of a transition.
InvokeBuilder = void Function(InvokeDefinition<AutomataState, AutomataEvent, dynamic>)
A function used to compose a InvokeDefinition.
InvokeSrcCallback<Result> = Future<Result> Function(AutomataEvent e)
The asynchronous function to be called by a StateNode that contains a InvokeDefinition.
OnEntryAction = void Function(AutomataEvent? event)
A function called when a AutomataState is entered.
OnExitAction = void Function(AutomataEvent? event)
A function called when a AutomataState is left.
OnTransitionCallback = void Function(AutomataEvent e, StateMachineValue value)
A function called on every transition.
StateBuilder<S extends AutomataState> = void Function(StateNode<S>)
A function used to compose StateNodes into our state machine.