States class

Inheritance

Constructors

States({String? id = null})
Create a state machine and populate with states

Properties

all List<StatesTransition>
no setteroverride
current String?
What is the current state?
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
id String?
getter/setter pair
locked bool
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

actions({String? from}) List<StatesTransition>
What are the valid actions you can perform from the current state?
override
add(String state) StatesMeta?
Adds a new state to the state machine.
override
change({required String toStateName, bool run = true}) bool
Move from the current state to another state.
override
dispose() → void
override
execute(String action) bool
Change the current state by performing an action.
override
get(String action) StatesTransition?
override
has({String? action, String? state, bool conform = true}) bool
Does an action exist in the state machine?
override
lock({required String key}) → void
override
metas({String? from}) List<StatesMeta>
What are the valid states you can get to from the current state?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(String action, StatesTransitionHandler handler) bool
Adds handler to the specific action
override
reset() → void
Go back to the initial starting state
override
subscribe(StatesTransitionHandler func, {bool single = false}) String?
override
toString() String
A string representation of this object.
inherited
unlock({required String key}) → void
override
unsubscribe(String subscriptionKey) bool
override
when({required String at, required String to, required String on, StatesTransitionHandler? handler}) StatesTransition?
Add a valid link between two states. The state machine can then move between
override

Operators

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

Constants

DISPOSE → const String
EXCEPTION__LOCK_KEY → const String