Machine<T> class
The state machine itself.
- Annotations
-
- @optionalTypeArgs
Constructors
- Machine()
- Constructor of a state machine.
Properties
-
current
↔ State<
T> ? -
Returns the current state of this machine, or
null
.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
-
onAfterTransition
→ Stream<
AfterTransitionEvent< T> > -
Returns an event stream that is triggered after each transition.
no setter
-
onBeforeTransition
→ Stream<
BeforeTransitionEvent< T> > -
Returns an event stream that is triggered before each transition.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
states
→ Iterable<
State< T> > -
Returns the states of this machine.
no setter
Methods
-
createState(
T identifier) → State< T> - Internal helper that can be overridden by subclasses to customize the creation of State objects.
-
newStartState(
T identifier) → State< T> - Returns a new start state for this machine.
-
newState(
T identifier) → State< T> -
Returns a new state. The first call to this method defines the start state
of the machine. To identify states a unique
identifier
has to be provided. -
newStopState(
T identifier) → State< T> - Returns a new stop state for this machine.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → void - Sets the machine to its start state.
-
stop(
) → void - Sets the machine to its stop state.
-
toString(
) → String -
Returns a debug string of this state.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
T identifier) → State< T> - Returns the state of the provided identifier.