ZipReader class

Minimal hand-written ZIP reader that parses the End-Of-Central-Directory record and Central Directory File Headers to list entries, and reads individual entries' bytes via their Local File Header, using ZLibDecoder (raw-deflate mode) from dart:io (SDK-provided) for DEFLATE decompression. Supports STORED (0) and DEFLATE (8) methods only, which covers the overwhelming majority of zip/SCORM/office packages in practice.

This replaces the third-party archive package.

Constructors

ZipReader.decodeBytes(Uint8List bytes)
Parses bytes as a zip archive's central directory.
factory

Properties

entries List<ZipEntry>
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBytes(ZipEntry entry) Uint8List
Reads and (if needed) decompresses the content of entry.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

listEntries(File file) Future<List<ZipEntry>>
Lists a zip archive's entries (names/sizes only — no content access; there is no readBytes on the result) by reading only its tail (the End-Of-Central-Directory record and Central Directory), never the whole file.