AtomLink.parse constructor

AtomLink.parse(
  1. XmlElement element
)

Parse constructor for the AtomLink class, used when 'parsing' a feed

Implementation

factory AtomLink.parse(XmlElement element) {
  final href = element.getAttribute('href');
  final rel = element.getAttribute('rel');
  final type = element.getAttribute('type');
  final title = element.getAttribute('title');
  final hreflang = element.getAttribute('hreflang');
  var length = 0;
  if (element.getAttribute('length') != null) {
    length = int.parse(element.getAttribute('length')!);
  }
  return AtomLink(href, rel, type, hreflang, title, length);
}