update method

dynamic update(
  1. String state
)

Implementation

update(String state) {
  if (_states.indexOf(_state) < 0) {
    throw 'actualizacion invalidad de estado, buscando $state en $_states';
  }
  _state = state;
  _stateController.add(state);
  // Si llegamos al estado final, cerramos el stream
  if (started) {
    _stateController.close();
    _stateController = StreamController<String>();
  }
}