The Webfeed Flutter package for Appeto SDK.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 regels
668 B

  1. import 'package:http/http.dart' as http;
  2. import 'package:webfeed/domain/atom_feed.dart';
  3. import 'package:webfeed/domain/rss_feed.dart';
  4. void main() {
  5. var client = new http.Client();
  6. // RSS feed
  7. client.get("https://developer.apple.com/news/releases/rss/releases.rss").then((response) {
  8. return response.body;
  9. }).then((bodyString) {
  10. var channel = new RssFeed.parse(bodyString);
  11. print(channel);
  12. return channel;
  13. });
  14. // Atom feed
  15. client.get("https://www.theverge.com/rss/index.xml").then((response) {
  16. return response.body;
  17. }).then((bodyString) {
  18. var feed = new AtomFeed.parse(bodyString);
  19. print(feed);
  20. return feed;
  21. });
  22. }