BcData.fromXML constructor

BcData.fromXML(
  1. String xmlSTR
)

Implementation

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

  String? str = document.firstChild?.text;
  String bcTypeCode = document.firstChild!
      .attributes
      .firstWhere((element) => element.name.toString() == "bcTypeCode")
      .value;
  String readStatus = document.firstChild!
      .attributes
      .firstWhere((element) => element.name.toString() == "readStatus")
      .value;

  return BcData(bcTypeCode: bcTypeCode, readStatus: readStatus, dataSTR: str);
}