kakajansh / echo

Laravel Echo for your Flutter apps.
MIT License
108 stars 69 forks source link

How to emit msgs to the socket server #6

Closed Wissa-Azmy closed 5 years ago

Wissa-Azmy commented 5 years ago

Please add a working flutter app example or add the emit method to the readme code

kakajansh commented 5 years ago

Added working example, but they are mostly for listening events. If you want to emit event, you can get socket instance. As it uses socket_io_client package you can do something like that:

echo.socket.emit('message', 'your message here');
Wissa-Azmy commented 5 years ago

The getter 'socket' isn't defined for the class 'echo'.

kakajansh commented 5 years ago

did you update to the latest version?

Wissa-Azmy commented 5 years ago

@kakajansh Thank you for your prompt response. You've done a great job indeed in the new version. The example app you added is awesome as well. And I see that you've already added the socket getter to the echo class but unfortunately I can't test it due to another issue to which I'll create a new thread since this one is closed.