class ChapterInfo { List chapters; String version; ChapterInfo({this.chapters, this.version}); ChapterInfo.fromJson(Map json) { if (json['chapters'] != null) { chapters = []; json['chapters'].forEach((v) { chapters.add(Chapters.fromJson(v)); }); } version = json['version']; } } class Chapters { String img; int startTime; String title; String url; Chapters({this.img, this.startTime, this.title, this.url}); Chapters.fromJson(Map json) { img = json['img']; startTime = json['startTime']; title = json['title']; url = json['url']; } Map toJson() { final data = {}; data['img'] = img; data['startTime'] = startTime; data['title'] = title; data['url'] = url; return data; } }