ChapterPassage constructor
ChapterPassage(
- BibleBookEnum book,
- int startChapter, [
- int? endChapter
Implementation
factory ChapterPassage(
BibleBookEnum book,
int startChapter, [
int? endChapter,
]) {
_validateReferenceNumber(
startChapter,
component: 'startChapter',
maximum: maxReferenceChapterNumber,
);
if (endChapter != null) {
_validateReferenceNumber(
endChapter,
component: 'endChapter',
maximum: maxReferenceChapterNumber,
);
if (endChapter <= startChapter) {
throw ArgumentError.value(
endChapter,
'endChapter',
'must come after startChapter',
);
}
}
return ChapterPassage._(book, startChapter, endChapter);
}