The Webfeed Flutter package for Appeto SDK.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

24 righe
562 B

  1. import 'dart:async';
  2. import 'package:http/http.dart' as http;
  3. import 'package:webfeed/domain/rss_feed.dart';
  4. class WebFeedClient {
  5. http.Client client;
  6. WebFeedClient(http.Client httpClient) {
  7. client = httpClient;
  8. }
  9. Future<RssFeed> fetch(String url) {
  10. return client.get(url).then((response) {
  11. print("Response Status Code: ${response.statusCode}");
  12. print("Response Body: ${response.body}");
  13. return response.body;
  14. }).then((bodyString) {
  15. var channel = new RssFeed.parse(bodyString);
  16. return channel;
  17. });
  18. }
  19. }