removeStateByStateName method
This method is usefull to remove a state passing stateName on demand.
Implementation
void removeStateByStateName(String stateName, [bool shouldDispatch = true]) {
var index = _states.indexWhere((bs) => bs.name == stateName);
if (index != -1) {
_states.removeAt(index);
if (shouldDispatch) {
//dispatch(Action(type: 'remove_state(${stateName})'));
_action = Action(type: 'remove_state(${stateName})');
var state = value;
state.remove(stateName);
_store.add(state);
}
}
}