MqttClient class
Constructors
- MqttClient({required String url, String? identifier, String? prefix})
- So far, url must contains protocol and port, e.g. mqtt://localhost:1883
Properties
- connected → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- identifier → String
-
no setter
- onAutoReconnect ↔ (void Function()?)
-
getter/setter pair
- onConnected ↔ (void Function()?)
-
getter/setter pair
- onDisconnected ↔ (void Function()?)
-
getter/setter pair
- onSubscribed ↔ (void Function(String?)?)
-
getter/setter pair
- onUnsubscribed ↔ (void Function(String?)?)
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
[String? username, String? password]) → Future< void> -
disconnect(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
publish(
Map< String, dynamic> payload) → void -
registerHandler(
String type, MqttHandler handler) → void - Register a unique handler for every message type.
-
subscribe(
String topic) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
-
unregisterHandle(
String type, MqttHandler handler) → void - Unregister a unique handler for every message type.
-
unsubscribe(
String topic) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited