openTableOfContents method
dynamic
openTableOfContents()
Implementation
openTableOfContents() async {
bool? shouldUpdate = await Navigator.of(context).push(MaterialPageRoute(
builder: (context) => ChaptersList(
bookId: bookId,
chapters: chaptersList,
leadingIcon: null,
accentColor: widget.accentColor,
chapterListTitle: widget.chapterListTitle,
))) ??
false;
if (shouldUpdate) {
var index = bookProgress.getBookProgress(bookId).currentChapterIndex ?? 0;
///Set page to initial and update chapter index with content
await bookProgress.setCurrentPageIndex(bookId, 0);
reLoadChapter(index: index);
}
}