socket.io-client-dart
socket.io-client-dart copied to clipboard
Getting error when connecting to backend
When I try connecting my flutter app, I get the following error:
_TypeError (type 'Null' is not a subtype of type 'int')
Here's my code:
IO.Socket? _socket;
_socket = IO.io('${Constants.wsUrl}',
IO.OptionBuilder().enableForceNew().setTransports(['websocket']).setQuery({'token': token, 'payload': json.encode(payload)}).build());