StateGraph<Event, State> class

State graph.

Defined by States and Events. Makes transitions based on graph and (optionally) globalEvents.

Constructors

StateGraph(Map<Type, Map<Type, StateTransitionEntry<State, Event>>> graph, {Map<Type, StateTransitionEntry<State, Event>> globalEvents = const {}})
State graph.

Properties

globalEvents Map<Type, StateTransitionEntry<State, Event>>
Optional map of global events which can be called in any State.
final
graph Map<Type, Map<Type, StateTransitionEntry<State, Event>>>
Map defines State to list of available Events. Each entry refers to transition.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(State state, Event event) → State
Makes transition from state on event based on graph.
callSideEffect(State state, Event event) → void
Calls side effect defined in graph for state and event.
findTransitionEntry(State state, Event event) StateTransitionEntry<State, Event>?
Finds graph's StateTransitionEntry for state and event. If there's no such entry, globalEvents lookup is made. If no entry is found, null is returned.
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