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.

21 lines
535 B

  1. import 'package:xml/xml.dart';
  2. class ItunesCategory {
  3. final String category;
  4. final List<String> subCategories;
  5. ItunesCategory({this.category, this.subCategories});
  6. factory ItunesCategory.parse(XmlElement element) {
  7. if (element == null) return null;
  8. return ItunesCategory(
  9. category: element.getAttribute('text')?.trim(),
  10. subCategories: element
  11. .findElements('itunes:category')
  12. ?.map((e) => e.getAttribute('text')?.trim())
  13. ?.toList() ??
  14. [],
  15. );
  16. }
  17. }