parse static method

Embed? parse(
  1. XmlElement? element
)

Implementation

static Embed? parse(XmlElement? element) {
  if (element == null) {
    return null;
  }
  return Embed(
    url: element.getAttribute('url'),
    width: int.tryParse(element.getAttribute('width') ?? '0') ?? 0,
    height: int.tryParse(element.getAttribute('height') ?? '0') ?? 0,
    params: element
        .findElements('media:param')
        .map((e) => Param.parse(e))
        .toList(),
  );
}