Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every time I try to do anything it connects me as a new Client to the socket and the messages which are sent are repeating again and again, Please Help #15

Closed
prkhrv opened this issue Feb 16, 2019 · 5 comments

Comments

@prkhrv
Copy link

prkhrv commented Feb 16, 2019

carbon 25

@prkhrv prkhrv changed the title Every time I try to anything it connects me as a new Client to the socket, Please Help Every time I try to do anything it connects me as a new Client to the socket and the messages which are sent are repeating again and again, Please Help Feb 16, 2019
@ekeshi1
Copy link

ekeshi1 commented Feb 18, 2019

That may be because you are connecting inside the Build method , which is run everytime the state of the widget changes. Try handling your sockets outside the Build method.

@prkhrv
Copy link
Author

prkhrv commented Feb 18, 2019

Thank You @ekeshi1 I have figured it out, it's now working fine. :)

@madqueendany
Copy link

Do you mind sharing your solution @prkhrv ?

@prkhrv
Copy link
Author

prkhrv commented Mar 21, 2019

@kevinespaldon Hi, I just switched to another Package called adhara_socket_io
link:- https://pub.dartlang.org/packages/adhara_socket_io#-readme-tab

It works fine by creating a single instance of the socket in the initState. You can use that too.

@madqueendany
Copy link

@prkhrv Thank you! Will try this one out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants