MSTrackData.fromXML constructor

MSTrackData.fromXML(
  1. String xmlSTR
)

Implementation

factory MSTrackData.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);

  XmlElement? dataElement = document.firstChild!.getElement("blockData");

  String trackID = document.firstChild!
      .attributes
      .firstWhere((element) => element.name.toString() == "trackID")
      .value;
  BlockData data = BlockData.fromXML(dataElement!.toXmlString());
  return MSTrackData(trackID: trackID, blockData: data);
}