class MonthlyListResponse { final List result; MonthlyListResponse({required this.result}); factory MonthlyListResponse.fromJson(Map json) { return MonthlyListResponse( result: List.from( json['result'].map((x) => MonthlyItem.fromJson(x)), ), ); } } class MonthlyItem { final int id; final String title; final String image; final String description; final int pageNumber; final String publishedAt; final String file; final List tags; bool isLiked; bool isBookmarked; MonthlyItem({ required this.id, required this.title, required this.image, required this.description, required this.pageNumber, required this.publishedAt, required this.file, required this.tags, this.isLiked = false, this.isBookmarked = false, }); factory MonthlyItem.fromJson(Map json) { return MonthlyItem( id: json['id'], title: json['title'], image: json['image'], description: json['description'] ?? '', pageNumber: json['pageNumber'], publishedAt: json['publishedAt'], file: json['file'], tags: List.from( json['tags'].map((x) => MonthlyTag.fromJson(x)), ), isLiked: json['isLiked'] ?? false, isBookmarked: json['isBookmarked'] ?? false, ); } } class MonthlyTag { final int id; final String label; MonthlyTag({required this.id, required this.label}); factory MonthlyTag.fromJson(Map json) { return MonthlyTag( id: json['id'], label: json['label'], ); } }