StateGraph<Event, State> class
State graph.
Defined by State
s and Event
s. Makes transitions based on graph and (optionally) globalEvents.
Constructors
-
StateGraph(Map<
Type, Map< graph, {Map<Type, StateTransitionEntry< >State, Event> >Type, StateTransitionEntry< globalEvents = const {}})State, Event> > - 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 availableEvent
s. 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
onevent
based on graph. -
callSideEffect(
State state, Event event) → void -
Calls side effect defined in graph for
state
andevent
. -
findTransitionEntry(
State state, Event event) → StateTransitionEntry< State, Event> ? -
Finds graph's StateTransitionEntry for
state
andevent
. 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