I am developing an app in flutter where I want to show an RSS feed with the webfeed plugin.
I am following the example exactly, but the only thing that is printed is:
Instance of 'RssFeed'
Shouldn't it print the whole RSS feed? Or have I understood something wrong?
The code:
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:webfeed/webfeed.dart';
class Food extends StatelessWidget{
final client = http.Client();
rssStream(){
client.get("https://developer.apple.com/news/releases/rss/releases.rss").then((response) {
return response.body;
}).then((bodyString) {
var channel = new RssFeed.parse(bodyString);
print(channel);
return channel;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: Image.asset('assets/icon.png'),
title: Text('App'),
),
body: rssStream(),
);
}
}
Everything you're seeing is correct. You're printing out an instance of the RssFeed. You need to print out the properties you want.
Looking at the code in gihub I can see a few properties. The one you're interested in most is probably items. Which are instances of RssItem. Look at the RssItem and print out the properties details you want to print out there.
Just have a look at the code to see the model structure yourself to get some better insights.