Price.parse constructor
Price.parse(
- XmlElement element
Factory method to parse an XmlElement
and create a Price object from it.
The element
is an XML element containing the price information.
Returns the parsed Price object.
Implementation
factory Price.parse(XmlElement element) {
return Price(
price: double.tryParse(element.getAttribute('price') ?? '0'),
type: element.getAttribute('type'),
info: element.getAttribute('info'),
currency: element.getAttribute('currency'),
);
}