disconnectAndClear method

void disconnectAndClear({
  1. void onDone()?,
})

Implementation

void disconnectAndClear({void Function() ? onDone}) {
  logger('disconnectAndClear');
  if (onDone != null) { disconnectAndClearOnDone = onDone; }

  notifyConnectionChanged(ConnectionStatus.disconnected);

  ws?.close();
  ws = null;
  connectionConfiguration = ConnectionConfiguration();
}