isConnected method
Implementation
@override
bool isConnected() {
if (_client == null) {
return false;
}
if (_client!.connectionStatus == null) {
return false;
}
return _client!.connectionStatus!.state == MqttConnectionState.connected;
}