isConnected method

  1. @override
bool isConnected()
override

Implementation

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