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.

26 lignes
632 B

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