reLoadChapter method

dynamic reLoadChapter({
  1. bool init = false,
  2. int index = -1,
})

Implementation

reLoadChapter({bool init = false, int index = -1}) async {
  int currentIndex =
      bookProgress.getBookProgress(bookId).currentChapterIndex ?? 0;

  setState(() {
    loadChapterFuture = loadChapter(
        index: init
            ? -1
            : index == -1
                ? currentIndex
                : index);
  });
}