{"id":15287719,"url":"https://github.com/soft2tec/universal_mqtt_client","last_synced_at":"2025-10-23T02:27:10.420Z","repository":{"id":56841574,"uuid":"266543551","full_name":"soft2tec/universal_mqtt_client","owner":"soft2tec","description":"A MQTT client for Dart, compatible with desktop, mobile and web targets","archived":true,"fork":false,"pushed_at":"2023-03-31T08:33:22.000Z","size":1740,"stargazers_count":9,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-01T15:35:28.138Z","etag":null,"topics":["dart","flutter","mqtt"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/universal_mqtt_client","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soft2tec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-05-24T13:11:18.000Z","updated_at":"2023-12-02T16:03:22.000Z","dependencies_parsed_at":"2022-08-29T06:50:57.551Z","dependency_job_id":null,"html_url":"https://github.com/soft2tec/universal_mqtt_client","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soft2tec%2Funiversal_mqtt_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soft2tec%2Funiversal_mqtt_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soft2tec%2Funiversal_mqtt_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soft2tec%2Funiversal_mqtt_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soft2tec","download_url":"https://codeload.github.com/soft2tec/universal_mqtt_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235581533,"owners_count":19013089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","mqtt"],"created_at":"2024-09-30T15:35:30.907Z","updated_at":"2025-10-07T02:31:40.635Z","avatar_url":"https://github.com/soft2tec.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# universal_mqtt_client\n\n[![Pub Version](https://img.shields.io/pub/v/universal_mqtt_client)](https://pub.dev/packages/universal_mqtt_client)\n\nA MQTT client for Dart that works on any Dart supported compile target (including\nFlutter and Flutter Web).\n\n## Features\n\n- Full support for MQTT 3.3.1\n- Support for MQTT over WebSocket on all Dart compile targets (including web)\n- Support for MQTT over TCP on mobile and desktop\n- Dart idiomatic API using promises and streams\n- Built in reconnect functionality\n- Full support for wildcard topics\n\n## Usage\n\n```dart\n/// To use this example you need to have a WebSocket `mqtt` server\n/// running on localhost:9000.\n\nimport 'package:universal_mqtt_client/universal_mqtt_client.dart';\n\nvoid main() async {\n  // Create a new UniversalMqttClient. This does not start the connection yet.\n  final client = UniversalMqttClient(broker: Uri.parse('ws://localhost:9000'));\n  client.status.listen((status) {\n    print('Connection Status: $status');\n  });\n\n  // We now call `client.connect()` to establish a connection with the MQTT broker.\n  // The returned promise resolves when the connection is successful, a timeout\n  // has been reached, or the broker responds with an error.\n  await client.connect();\n\n  // We now subscribe to the client and save the returned StreamSubscription\n  final subscription = client\n      .handleString('device_status/1', MqttQos.atLeastOnce)\n      .listen((message) =\u003e print('Device 1 Status: $message'));\n\n  // then publish a message to the topic we subscribed to.\n  client.publishString(\n      'device_status/1', 'Connected and running!', MqttQos.atLeastOnce);\n\n  // Then we wait a bit before we cancel our subscription.\n  await Future.delayed(Duration(seconds: 2));\n\n  // Now we can cancel our subscription. This means that any messages after this will\n  // not be recieved by the client anymore.\n  await subscription.cancel();\n\n  // Ultimatly we clean up our connection by disconnecting from the broker.\n  client.disconnect();\n}\n```\n\n## Bugs and feature requests\n\nPlease file feature requests and bugs at the [issue tracker][tracker]. If you find any security\nrelated issues, please follow the guidance in the `SECURITY.md` file. Thanks :-)\n\n[tracker]: https://github.com/soft2tec/universal_mqtt_client\n\n## Licence\n\nThis project is licensed under the MIT licence. More information can be found in the `LICENCE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoft2tec%2Funiversal_mqtt_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoft2tec%2Funiversal_mqtt_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoft2tec%2Funiversal_mqtt_client/lists"}