getStateIndex method

int? getStateIndex(
  1. StateIdentifier id
)

Provides the corresponding index held in state signals such as nextState and currentState based on the provided id.

Returns null if the id does not have a defined state in the machine.

Implementation

int? getStateIndex(StateIdentifier id) {
  if (!_stateLookup.containsKey(id)) {
    return null;
  }

  return _stateValueLookup[_stateLookup[id]];
}