MqttCommunicator constructor
MqttCommunicator({})
Implementation
MqttCommunicator({
required String server,
required int port,
String? username,
String? password,
String? clientIdentifier,
bool autoReconnect = true,
bool secure = true,
}) {
this.server = server;
this.port = port;
this.username = username;
this.password = password;
clientId = clientIdentifier ??
"florafi_dart_" + Random().nextInt(1 << 32).toString();
final client = mqtt = MqttServerClient.withPort(server, clientId, port);
client.setProtocolV311();
client.secure = secure;
client.autoReconnect = autoReconnect;
messages = _messages.stream;
}