updateState method
Implementation
void updateState(CubitStateEntity newState) {
final states = {...state.states};
assert(states.containsKey(newState.id), 'State not found');
states[newState.id] = newState;
emit(
state.copyWith(
states: states,
stateHistory: [
...state.stateHistory,
newState,
],
),
);
}