The Webfeed Flutter package for Appeto SDK.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
856 B

  1. import 'package:webfeedclient/util/helpers.dart';
  2. import 'package:xml/xml.dart';
  3. class Item {
  4. final String title;
  5. final String description;
  6. final String link;
  7. final String guid;
  8. final String pubDate;
  9. Item(this.title, this.description, this.link, {this.guid, this.pubDate});
  10. factory Item.parse(XmlElement element) {
  11. var title = xmlGetString(element, "title");
  12. var description = xmlGetString(element, "description");
  13. var link = xmlGetString(element, "link");
  14. var guid = xmlGetString(element, "guid", strict: false);
  15. var pubDate = xmlGetString(element, "pubDate", strict: false);
  16. return new Item(title, description, link, guid: guid, pubDate: pubDate);
  17. }
  18. @override
  19. String toString() {
  20. return '''
  21. title: $title
  22. description: $description
  23. link: $link
  24. pubDate: $pubDate
  25. ''';
  26. }
  27. }