AtomItem.parse constructor

AtomItem.parse(
  1. XmlElement element
)

Implementation

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