Book.fromJson constructor

Book.fromJson(
  1. Map<String, dynamic> json
)

Implementation

Book.fromJson(Map<String, dynamic> json) {
  title = json['title'];
  titleId = json['title-id'];
  mainType = json['main-type'];
  lang = json['lang'].cast<String>();
  if (json['collection'] != null) {
    collection = <Collection>[];
    json['collection'].forEach((v) {
      collection!.add(Collection.fromJson(v));
    });
  }
}