SdData.fromXML constructor

SdData.fromXML(
  1. String xmlSTR
)

Implementation

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

  String weight = document.firstChild!
      .attributes
      .firstWhere((element) => element.name.toString() == "weight")
      .value;
  String readStatus = document.firstChild!
      .attributes
      .firstWhere((element) => element.name.toString() == "readStatus")
      .value;
  return SdData(readStatus: readStatus, weight: weight);
}