PSpgEnteredEvent.fromXML constructor
PSpgEnteredEvent.fromXML(
- String xmlSTR
Implementation
factory PSpgEnteredEvent.fromXML(String xmlSTR) {
final document = XmlDocument.parse(xmlSTR);
String messageName = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "messageName").value;
String messageID = document.rootElement.attributes.firstWhere((p0) => p0.name.toString() == "messageID").value;
XmlElement eventElement = document.rootElement.findAllElements("pSpgEnteredEvent").first;
String admin = eventElement.attributes.firstWhere((p0) => p0.name.toString() == "admin", orElse: orElseEmpty).value;
return PSpgEnteredEvent(
messageName: messageName,
messageID: int.parse(messageID),
admin: admin,
);
}