reset method

void reset(
  1. S initialState
)

Resets the bloc to its initial state.

Parameters:

  • initialState: The state to reset the bloc to.

Usage:

void cleanUp() {
  reset(const CounterState.initial());
}

Implementation

void reset(S initialState) {
  // ignore: invalid_use_of_visible_for_testing_member
  emit(initialState);
}