connect method

Future<void> connect()

Creates a new WebSocket connection after instantiated WebsocketManager.

From this point the messages are being listened, but you need to call onMessage or onClose functions, providing a callback function, to be able to listen data sent from the server and a done event.

Implementation

Future<void> connect() async {
  _onMessage();
  await _channel.invokeMethod<dynamic>(_METHOD_CHANNEL_CONNECT);
}