Epub.fromFile constructor

Epub.fromFile(
  1. File file
)

Constructs an Epub instance from a File.

The file parameter should point to a valid EPUB file.

Implementation

Epub.fromFile(File file)
    : assert(file.path._extension == 'epub'),
      zip = ZipDecoder().decodeBytes(file.readAsBytesSync()) {
  _metadata = Lazy(_initializeMetadata);
  _items = Lazy(_initializeItems);
  _sections = Lazy(_initializeSections);
}