I am using bloc state management in the Flutter framework, and I am working on an application that uses a socket with chat. I want as soon as the user leaves the room, I send an event to the socket so that he leaves the chat, but I see the error attached to you in the address, what is the solution?
2
Answers
Try wrapping the code with this:
and see what it will show!
Have you tried to warp this screen with WillPopScope. There is a function to execute an action before user go back