unSubscribe method

Future<void> unSubscribe(
  1. String topic
)

Implementation

Future<void> unSubscribe(String topic) async {
  _subList.remove(topic);
  _dataArriveCallBack.remove(topic);
  _finishedSubCache.remove(topic);
  var msg = MqttMessageUnSubscribe.withTopic([topic]);
  msg.withMessageID(MessageIdentifierDispenser().getNextMessageIdentifier());
  _send(msg);
  return;
}