close method

void close()

Close the WebSocket connection and prevent any future reconnection attempts

Implementation

void close() {
  manuallyClosed = true;
  ws?.sink.close();
}