sendText method

void sendText(
  1. String str
)

Send a message through websocket websocket connection

Implementation

void sendText(String str) {
  if (!isConnected || _connecting) {
    throw Exception('Tried sending data but you are not connected yet.');
  }
  _channel?.sink.add(str);
}