import 'package:didvan/models/tag.dart'; 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 String createdAt; bool marked; bool liked; final List tags; Content( {required this.id, required this.marked, required this.liked, required this.createdAt, required this.title, required this.image, required this.category, required this.tags}); factory Content.fromJson(Map json) { return Content( id: json['id'], marked: json['marked'], liked: json['liked'], createdAt: json['createdAt'], 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'], // ); // } // }