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;
}