getChapters method

List<Chapter> getChapters()

Returns all chapters found as a list.

Implementation

List<Chapter> getChapters() {
  final List<Chapter> list = List<Chapter>.empty(growable: true);

  dynamic createChapter(Map<dynamic, dynamic> chapterProperties) =>
      list.add(new Chapter(chapterProperties));

  this._allProperties?["chapters"]?.forEach((Object? chapter) {
    createChapter(chapter as Map<dynamic, dynamic>);
  });

  return list;
}