parseChapters method

Future<List<EpubChapter>> parseChapters()

Parsing chapters list form epub

Implementation

Future<List<EpubChapter>> parseChapters() async {
  if (chapters.isNotEmpty) return chapters;
  checkEpubLoaded();
  final result =
      await webViewController!.evaluateJavascript(source: 'getChapters()');
  chapters =
      List<EpubChapter>.from(result.map((e) => EpubChapter.fromJson(e)));
  return chapters;
}