updateState method

void updateState(
  1. S state
)

Updates the current state of the Cubit if it is not closed.

Implementation

void updateState(S state) {
  if (!isClosed) {
    emit(state);
  }
}