Embed.parse constructor

Embed.parse(
  1. XmlElement element
)

Implementation

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