The Webfeed Flutter package for Appeto SDK.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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