InterfaceModeRequest.fromXML constructor

InterfaceModeRequest.fromXML(
  1. String xmlSTR
)

Implementation

factory InterfaceModeRequest.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);
  String mode = document.rootElement.childElements.first.attributes
      .firstWhere((p0) => p0.name.toString() == "mode", orElse: orElseEmpty)
      .value;
  String messageID = document.rootElement.attributes
      .firstWhere((p0) => p0.name.toString() == "messageID")
      .value;

  return InterfaceModeRequest(mode: mode, messageID: int.parse(messageID));
}