fromAtom static method

WebFeed fromAtom(
  1. AtomFeed atomFeed
)

Implementation

static WebFeed fromAtom(AtomFeed atomFeed) {
  return WebFeed(
    title: atomFeed.title ?? '',
    description: atomFeed.subtitle ?? '',
    links: atomFeed.links.map((atomLink) => atomLink.href).toList(),
    items: atomFeed.items
        .map(
          (item) => WebFeedItem(
            title: item.title ?? '',
            body: item.summary ?? item.content ?? '',
            updated: SafeParseDateTime.safeParse(item.updated) ?? SafeParseDateTime.safeParse(item.published),
            links: item.links.map((atomLink) => atomLink.href).toList(),
          ),
        )
        .toList(),
  );
}