class InfographyContent { final List contents; final int lastPage; InfographyContent({required this.contents, required this.lastPage}); factory InfographyContent.fromJson(Map json) { return InfographyContent( contents: List.from(json['contents'].map((x) => Content.fromJson(x))), lastPage: json['lastPage'], ); } } class Content { final int id; final String title; final String image; final String category; final List tags; Content( {required this.id, required this.title, required this.image, required this.category, required this.tags}); factory Content.fromJson(Map json) { return Content( id: json['id'], title: json['title'], image: json['image'], category: json['category'], tags: List.from(json['tags'].map((x) => Tag.fromJson(x))), ); } } class Tag { final int id; final String label; Tag({required this.id, required this.label}); factory Tag.fromJson(Map json) { return Tag( id: json['id'], label: json['label'], ); } }