chapters property

List<Chapter>? chapters

Creates a list containing every chapter found within this reference.

Onces called this list is cached so subsequent calls will be quicker.

Implementation

List<Chapter>? get chapters {
  if (_chapters != null) {
    return _chapters;
  }
  _chapters = <Chapter>[];
  for (var i = startChapterNumber; i <= endChapterNumber!; i++) {
    _chapters!.add(Chapter(book, i));
  }
  return _chapters;
}