2020-02-26 10:54:59 +01:00
|
|
|
import 'package:tsacdop/webfeed/util/helpers.dart';
|
2020-02-09 13:29:09 +01:00
|
|
|
import 'package:xml/xml.dart';
|
|
|
|
|
|
|
|
class AtomSource {
|
|
|
|
final String id;
|
|
|
|
final String title;
|
|
|
|
final String updated;
|
|
|
|
|
|
|
|
AtomSource(this.id, this.title, this.updated);
|
|
|
|
|
|
|
|
factory AtomSource.parse(XmlElement element) {
|
|
|
|
if (element == null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
var id = findElementOrNull(element, "id")?.text;
|
|
|
|
var title = findElementOrNull(element, "title")?.text;
|
|
|
|
var updated = findElementOrNull(element, "updated")?.text;
|
|
|
|
|
|
|
|
return AtomSource(id, title, updated);
|
|
|
|
}
|
|
|
|
}
|