mapPagesToChapter static method

Map<String, int>? mapPagesToChapter(
  1. List<EpubChapter>? chapters
)

Implementation

static Map<String, int>? mapPagesToChapter(List<EpubChapter>? chapters) {
  if (chapters == null) return null;
  var map = <String, int>{};
  for (var i = 0; i < chapters.length; i++) {
    var epubChapter = chapters[i];
    map[epubChapter.ContentFileName!] = i;
  }
  return map;
}