readBook static method

Future<EpubBook> readBook(
  1. List<int> bytes
)

Opens the book asynchronously and reads all of its content into the memory. Does not hold the handle to the EPUB file.

Implementation

static Future<EpubBook> readBook(List<int> bytes) async {
  final epubBookRef = await openBook(bytes);
  final chapterRefs = await epubBookRef.getChapters();
  final result = EpubBook(
    epubBookRef.title,
    epubBookRef.author,
    epubBookRef.authorList,
    epubBookRef.schema,
    await readContent(epubBookRef.content),
    await epubBookRef.readCover(),
    await readChapters(chapterRefs),
  );

  return result;
}