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

Flutter package for mqtt client boilerplate code

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: 0.0.1

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.
5
likes
0
pub points
58%
popularity

Publisher

unverified uploader

Flutter package for mqtt client boilerplate code

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, mqtt_client

More

Packages that depend on mqtt_helper