2023-07-18 21:36:26 +00:00
|
|
|
class FeedResponse {
|
|
|
|
final List<InscriptionLink> inscriptions;
|
|
|
|
|
2023-07-19 15:37:42 +00:00
|
|
|
FeedResponse({required this.inscriptions});
|
2023-07-18 21:36:26 +00:00
|
|
|
|
|
|
|
factory FeedResponse.fromJson(Map<String, dynamic> json) {
|
2023-07-19 15:37:42 +00:00
|
|
|
final List<dynamic> inscriptionsJson = json['_links']['inscriptions'] as List<dynamic>;
|
|
|
|
final List<InscriptionLink> inscriptions = inscriptionsJson
|
|
|
|
.map((json) => InscriptionLink.fromJson(json as Map<String, dynamic>))
|
2023-07-18 21:36:26 +00:00
|
|
|
.toList();
|
|
|
|
|
2023-07-19 15:37:42 +00:00
|
|
|
return FeedResponse(inscriptions: inscriptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class InscriptionLink {
|
|
|
|
final String href;
|
|
|
|
final String title;
|
|
|
|
|
|
|
|
InscriptionLink({required this.href, required this.title});
|
|
|
|
|
|
|
|
factory InscriptionLink.fromJson(Map<String, dynamic> json) {
|
|
|
|
return InscriptionLink(
|
|
|
|
href: json['href'] as String ?? '',
|
|
|
|
title: json['title'] as String ?? '',
|
|
|
|
);
|
2023-07-18 21:36:26 +00:00
|
|
|
}
|
|
|
|
}
|