getLastVerseNumber static method

int? getLastVerseNumber(
  1. dynamic book, [
  2. int? chapter
])

Gets the last verse number in a specified book or book or chapter.

Implementation

static int? getLastVerseNumber(dynamic book, [int? chapter]) {
  if (book is String) {
    book = findBookNumber(book);
  }
  if (book is! int) {
    return null;
  }
  chapter ??= BibleData.lastVerse[book - 1].length;
  if (BibleData.lastVerse[book - 1].length < chapter || chapter < 1) {
    return null;
  }
  return BibleData.lastVerse[book - 1][chapter - 1];
}