Page.fromJson constructor

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

Implementation

Page.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
  id = json['id'];
  pageNumber = json['page_number'];
  narrationId = json['narration_id'];
  chapterId = json['chapter_id'];
  bookId = json['book_id'];
  partId = json['part_id'];
  subPartId = json['sub_part_id'];
  image = json['image'];

  if (json['verses'] != null) {
    verses = <Verse>[];
    json['verses'].forEach((v) {
      verses!.add(Verse.fromJson(v));
    });
  }
  if (json['glyphs'] != null) {
    glyphs = <Glyph>[];
    json['glyphs'].forEach((v) {
      glyphs!.add(Glyph.fromJson(v));
    });
  }
}