Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for media:content url #38

Open
smv1999 opened this issue Dec 17, 2020 · 1 comment
Open

Add support for media:content url #38

smv1999 opened this issue Dec 17, 2020 · 1 comment

Comments

@smv1999
Copy link

smv1999 commented Dec 17, 2020

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!

@killbotXD
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants