
제가 방금 질문을 올렸는데 답변 완료 버튼을 잘못 눌러서 다시 질문합니다..
book.dart 코드 전체 올려봅니다.
class Book {
String id;
String title;
String subtitle;
List authors;
String publishedDate;
String thumbnail; // 썸네일 이미지 링크
String previewLink; // ListTile 을 눌렀을 때 이동하는 링크
Book({
required this.id,
required this.title,
required this.subtitle,
required this.authors,
required this.publishedDate,
required this.thumbnail,
required this.previewLink,
});
Map toJson() {
return {
"id": id,
"title": title,
"subtile": subtitle,
"authors": authors,
"publishedDate": publishedDate,
"thumbnail": thumbnail,
"previewLink": previewLink,
};
}
factory Book.fromJson(json) {
return Book(
id: json['id'],
title: json['title'],
subtitle: json['subtitle'],
authors: json['authors'],
publishedDate: json['publishedDate'],
thumbnail: json['thumbnail'],
previewLink: json['previewLink'],
);
}
}
