webfeed
webfeed copied to clipboard
Add support for media:content url
I am working with an RSS feed :
https://weworkremotely.com/categories/remote-programming-jobs.rss
I am not able to get the url of this GIF.
<media:content url="https://wwr-pro.s3.amazonaws.com/logos/0018/2781/logo.gif" type="image/png"/>
I tried various things such as item.media.group.content.attributes.url, but there doesn't seem to be a feature to support this!
This is my Code:
return ListView.builder(
itemCount: _feed.items.length,
itemBuilder: (BuildContext context, int index) {
final item = _feed.items[index];
return ListTile(
title: title(item.title),
subtitle: subtitle(item.pubDate.toString()),
leading: thumbnail(item.media.group.content.attributes.url),
trailing: rightIcon(),
contentPadding: EdgeInsets.all(5.0),
onTap: () => openFeed(item.link),
);
},
);
It would be great, if this feature is added!
@smv1999 Try using
if (el.media != null && el.media.contents != null && el.media.contents.length > 0) {
src = el.media.contents.first.url;
}
where el
is your item this def works for me, using your rss feed too.
ps. the conditions inside the if statement may be redundant according to yourcase, I just pasted my own code snippet.