close method Null safety

  1. @override
void close()
override

Closes the connection to the Mqtt message broker.

Implementation

@override
void close() {
  if (connectionStatus.state == MqttConnectionState.connected) {
    disconnect();
  }
}