RssItem.parse constructor
RssItem.parse(
- XmlElement element
Parse constructor for the RssItem class, used when 'parsing' a feed
Implementation
factory RssItem.parse(XmlElement element) => RssItem(
title: element.findElements('title').firstOrNull?.text,
description:
removeHtml(element.findElements('description').firstOrNull?.text),
link: element.findElements('link').firstOrNull?.text,
categories:
element.findElements('category').map(RssCategory.parse).toList(),
guid: element.findElements('guid').firstOrNull?.text,
pubDate:
parseDateTime(element.findElements('pubDate').firstOrNull?.text),
author: element.findElements('author').firstOrNull?.text,
comments: element.findElements('comments').firstOrNull?.text,
source: element.findElements('source').map(RssSource.parse).firstOrNull,
content: element
.findElements('content:encoded')
.map(RssContent.parse)
.firstOrNull,
media: Media.parse(element),
enclosure: element
.findElements('enclosure')
.map(RssEnclosure.parse)
.firstOrNull,
dc: DublinCore.parse(element),
itunes: Itunes.parse(element),
);