socket.io-client-dart
socket.io-client-dart copied to clipboard
Question about Web and Arrays
- I just wanted to confirm that besides the Server... the dart client code will run in Chrome via Flutters beta version, right?
AND...
- In the Js version... I could receive an Array(of integers) too. Can i do that here too? or is the data in socket.on('event', (data) => print(data)); only suppose to be Json or String???
- Do you mean Flutter Web? Yes, this library should work in either Flutter or Flutter Web, as long as you specify a correct transports to connect.
- Sure, it should work with a list of integers, not JS's arguments array. For example,
//Nodejs
socket.emit('event', [1,2,3,4,5,6,7]);
//Dart client
socket.on('event', (data) {
print(data); // [1,2,3,4,5,6,7]
});