Storage.fromXML constructor

Storage.fromXML(
  1. String xmlSTR
)

Implementation

factory Storage.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);
  String storageT = document.firstChild!.attributes
      .firstWhere((element) => element.name.toString() == "storageT")
      .value;
  String path = document.firstChild!.attributes
      .firstWhere((element) => element.name.toString() == "path")
      .value;
  String driveLetter = document.firstChild!.attributes
      .firstWhere((element) => element.name.toString() == "driveLetter")
      .value;
  return Storage(storageT: storageT, path: path, driveLetter: driveLetter);
}