Error if you work with bloc.
flutter: Unhandled Exception: Bad state: Cannot add new events after calling close
The reason is framework is trying to add events after dispose() method being called. When the dispose() is called you can not call or add events for the bloc.
Make sure you are not calling dispose() method first. In my case I was using get_it for injecting bloc.
Here you see AuthBloc inside registerSingleton. RegisterSingleton was releasing the AuthBloc and not creating a new one once switched between different screens like login and register.
Because of registerSingleton, dispose() method was being called and I could not use add() method to add new events in the stream.
I changed from registerSingleton to registerFactory() and it worked and error is gone.
Clean architecture BLoC and Get_it