title: Bad state: Cannot add new events after calling close
body: <p>i have bloc that control my page, when the icon pressed i want to set the state to initial state, but i got Bad state: Cannot add new events after calling close</p>
  
  <p>this is my bloc code</p>
  
  <pre><code>class ForgotPasswordBloc
      extends Bloc&lt;ForgotPasswordEvent, ForgotPasswordState&gt; {
    UserRepository _userRepository = UserRepository();
  
    @override
    ForgotPasswordState get initialState =&gt; ForgotPasswordInitial();
  
    @override
    Stream&lt;ForgotPasswordState&gt; mapEventToState(
        ForgotPasswordEvent event) async* {
      if (event is RequestOTP) {
        yield ForgotPasswordInitialLoading();
  
        try {
          bool result = await _userRepository.requestOtp(
              forgotPasswordCredentials:
                  ForgotPasswordCredentials(noHp: event.noHp));
  
          if (!result)
            yield ForgotPasswordInitialFailure(error: "Phone number is invalid");
          else
            yield ForgotPasswordOTP();
        } catch (e) {
          yield ForgotPasswordInitialFailure(error: e.toString());
        }
      }
  
      if (event is BackToLoginInitial) {
        print("msk sini");
        yield ForgotPasswordInitialLoading();
      }
    }
  }
  </code></pre>
  
  <p>this is my page, and the button back</p>
  
  <pre><code>state is ForgotPasswordOTP
                            ? Positioned(
                                top: 66,
                                left: 0,
                                child: Container(
                                  alignment: Alignment.centerLeft,
                                  child: IconButton(
                                      icon: Icon(
                                        Icons.arrow_back,
                                        color: Colors.white,
                                      ),
                                      iconSize: 30,
                                      onPressed: () {
                                        // if (state is ForgotPasswordOTP)
                                        forgotPasswordBloc
                                            .add(BackToLoginInitial());
                                      }),
                                ),
                              )
                            : Container(),
  </code></pre>