DeviceQueryRequest.fromXML constructor

DeviceQueryRequest.fromXML(
  1. String xmlSTR
)

Implementation

factory DeviceQueryRequest.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);
  String messageID = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "messageID").value;
  String deviceName = document.rootElement.childElements
      .firstWhere((element) => element.name.toString() == "deviceQueryRequest")
      .attributes
      .firstWhere((p0) => p0.name.toString() == "deviceName",orElse: ()=>orElseEmpty())
      .value;
  return DeviceQueryRequest(messageID: int.parse(messageID), deviceName: deviceName);
}