I am developing a simple counter app using Flutter, with Cubit for state management. My app features 6 buttons, each designed to add 1, 2, or 3 points to two players (Player A and Player B). However, I've encountered a strange issue: when I attempt to add 1 point to Player A's score using its dedicated button, the app sometimes adds an incorrect amount (2, 4, or even 10 points) instead of the expected 1 point. Interestingly, I'm using the same component for Player B, and it works perfectly without any issues.A counter App view code: https://github.com/As-tra/Counter
I try to modify the logic but it seems correct
I have made few changes and added relevant comments as well to help you understand.
Remember, Bloc/cubit means events will be added to Bloc or method of cubit will be called and new state will correct state values will be emitted.