Skip to content
pubscout

async_zip

0.1.0, released 3 years ago by perron2.ch

A Flutter plugin to asynchronously read and write Zip files.

$ flutter pub add async_zip
Source repository

What it does

Allows fast reading and writing of Zip archives both synchronously and asynchronously with low memory consumption. It also provides functions to extract a Zip archive into a folder with optional progress callbacks. The underlying C library is integrated using Dart FFI.

AI-written summary of version 0.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to handle large Zip files on low or medium range devices without high memory consumption.
  • You require asynchronous Zip reading and writing capabilities in your Flutter application.

Skip it when

  • You do not want to rely on a native C library integration via FFI.
  • You are targeting platforms other than Android and iOS (as only android and ios platforms are listed).

Strengths

  • Low memory consumption compared to standard libraries that load entire files into memory.
  • Supports both synchronous and asynchronous operations.
  • Includes built-in extraction functions with progress tracking capabilities.

Weaknesses

  • Limited platform support explicitly documented (android, ios).
  • Requires manual resource management (must call `close()` to avoid leaks or unfinished zip files).

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
2

not documented

import 'package:async_zip/async_zip.dart';

final reader = ZipFileReader();
try {
  reader.open(File('path-to-archive.zip'));
  final entries = await reader.entries();
  for (final entry in entries) {
    print('${entry.name} ${entry.size}');
  }
} on ZipException catch (ex) {
  print('Could not read Zip file: ${ex.message}');
} finally {
  await reader.close();
}

Alternatives

Packages that do the same job and could replace async_zip.

  • archive

    Pick archive if you want a pure Dart solution without FFI bindings or if you need support for a wider variety of archive formats beyond just Zip.

Works with

Packages commonly used together with async_zip: ones it builds on, ones built on it, and its own family.