socket.io-client-dart icon indicating copy to clipboard operation
socket.io-client-dart copied to clipboard

Getting error when connecting to backend

Open steve-cahn opened this issue 3 years ago • 0 comments

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());

steve-cahn avatar May 13 '21 01:05 steve-cahn