AtomItem.parse constructor

AtomItem.parse(
  1. XmlElement element
)

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

Implementation

factory AtomItem.parse(XmlElement element) => AtomItem(
      id: element.findElements('id').firstOrNull?.innerText,
      title: element.findElements('title').firstOrNull?.innerText,
      updated: parseDateTime(
          element.findElements('updated').firstOrNull?.innerText,),
      authors: element.findElements('author').map(AtomPerson.parse).toList(),
      links: element.findElements('link').map(AtomLink.parse).toList(),
      categories:
          element.findElements('category').map(AtomCategory.parse).toList(),
      contributors:
          element.findElements('contributor').map(AtomPerson.parse).toList(),
      source:
          element.findElements('source').map(AtomSource.parse).firstOrNull,
      published: element.findElements('published').firstOrNull?.innerText,
      content: element.findElements('content').firstOrNull?.innerText,
      summary: element.findElements('summary').firstOrNull?.innerText,
      rights: element.findElements('rights').firstOrNull?.innerText,
      media: Media.parse(element),
    );