addState method

void addState (BaseState stateInstance)

This method is usefull to add a state passing stateInstance on demand.

Implementation

void addState(BaseState stateInstance) {
  removeStateByStateName(stateInstance.name, false);
  _states.add(stateInstance);
  dispatch(Action(type: 'add_state(${stateInstance.name})'));
}