feet/lib/api/feed.dart

39 lines
854 B
Dart
Raw Normal View History

2022-12-29 16:11:01 +00:00
part of fever_api;
class Feed {
final FeverAPI api;
late int id;
late int faviconId;
late String title;
late String url;
late String siteUrl;
late bool isSpark;
late DateTime lastUpdatedOnTime;
Feed(this.api, {
required this.id,
required this.faviconId,
required this.title,
required this.url,
required this.siteUrl,
required this.isSpark,
required this.lastUpdatedOnTime,
});
Feed.fromJSON(this.api, Map<String, dynamic> json) {
id = toInt(json['id']);
faviconId = toInt(json['favicon_id']);
title = json['title'];
url = json['url'];
siteUrl = json['site_url'];
2022-12-29 23:27:35 +00:00
isSpark = json['isSpark'] == 1;
2022-12-29 16:11:01 +00:00
lastUpdatedOnTime = DateTime.fromMillisecondsSinceEpoch(toInt(json['last_updated_on_time']) * 1000);
}
@override
String toString() {
return 'Feed $id: $title';
}
}