Describe the bug
I am having an issue with a bloc I implemented. The widget triggers the event when a button is tapped and the event reaches mapEventToState but no state is emitted and nothing happens on the UI. Also, if I observe it in the onChange() method, I see nothing. It only happens once.
To Reproduce
This is the project and branch in which I implement the bloc pattern: https://github.com/flutter-clutter/flutter-basic-calculator/tree/bloc. You can check it out and start. The first time a button is tapped, a output can be seen but any subsequent action is not logged.
What am I missing?
Hi @flutter-clutter 馃憢
Thanks for opening an issue!
Have you taken a look at the FAQs? It looks like the issue is the CalculationModel is not extending Equatable and the bloc is mutating the model instead of creating a new instance.
Hey @felangel.
Oh, it seems I was running into a common issue. Should have read the FAQ. You are right this issue was because I was re-using the model instead of creating a completely new one. Thank you for your quick response.
Most helpful comment
Hey @felangel.
Oh, it seems I was running into a common issue. Should have read the FAQ. You are right this issue was because I was re-using the model instead of creating a completely new one. Thank you for your quick response.