The Webfeed Flutter package for Appeto SDK.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
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. }