publish method
Implementation
void publish(String topic, String message, {bool retain = false}) {
final builder = MqttClientPayloadBuilder();
builder.addUTF8String(message);
if (builder.payload == null) return;
mqttClient?.publishMessage(topic, MqttQos.atLeastOnce, builder.payload!,
retain: retain);
log('Published to topic: $topic, message: $message');
}