disconnect method Null safety

void disconnect()

Disconnect from the broker. This is a hard disconnect, a disconnect message is sent to the broker and the client is then reset to its pre-connection state, i.e all subscriptions are deleted, on subsequent reconnection the use must re-subscribe, also the updates change notifier is re-initialised and as such the user must re-listen on this stream.

Do NOT call this in any onDisconnect callback that may be set, this will result in a loop situation.

This method will disconnect regardless of the autoReconnect state.


void disconnect() {
  _disconnect(unsolicited: false);