The Webfeed Flutter package for Appeto SDK.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

24 lignes
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. }