mqtt_helper 0.0.7 copy "mqtt_helper: ^0.0.7" to clipboard
mqtt_helper: ^0.0.7 copied to clipboard

mqtt_helper is a Flutter package that simplifies MQTT integration, reducing boilerplate code and providing a convenient layer on top of mqtt_client.

This package was initially created for internal use only, but can be used by anyone

Features #

  • Wrapper class covering everything for mqtt_client
  • Provides listeners on events and other callbacks for mqtt_client

Getting started #

Add it to your pubspec.yaml

mqtt_helper: <latest-version>

Usage #

  1. Create one instance of the helper class MqttHelper
var helper = MqttHelper();
  1. Initialize and Connect to the MqttClient with the helper
var config = MqttConfig(); // You'll need to pass your creds and configs inside MqttConfig
helper.initialize(config);

Additional Information #

  1. Use onConnectionChange() listener to listen to connection changes whether Mqtt is connected or not
  2. Use onEvent() listener to listen to events that will come.
  3. Use subscribeTopic() to subscribe to single topic.
  4. Use subscribeTopics() to subscribe to multiple topics at once.
  5. Use unsubscribeTopic() to unsubscribe to single topic.
  6. Use unsubscribeTopics() to unsubscribe to multiple topics at once.
4
likes
120
pub points
71%
popularity

Publisher

unverified uploader

mqtt_helper is a Flutter package that simplifies MQTT integration, reducing boilerplate code and providing a convenient layer on top of mqtt_client.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, mqtt_client

More

Packages that depend on mqtt_helper