flutter_archive 0.1.0 copy "flutter_archive: ^0.1.0" to clipboard
flutter_archive: ^0.1.0 copied to clipboard

outdated

Create and extract ZIP archive files in Android and in iOS. Zip all files in a directory recursively or a given list of files.

flutter_archive #

Create and extract ZIP archive files. Uses Android/Apple platform APIs for high performance and optimal memory usage.

Features #

  • Supports Android and iOS.
  • Modern plugin implementation based on Kotlin (Android) and Swift (iOS).
  • Zip all files in a directory (optionally recursively).
  • Zip a given list of files.
  • Unzip an archive file to a given directory.

Examples #

Zip a directory #

  final dataDir = Directory("data_dir_path");
  try {
    final zipFile = File("zip_file_path");
    FlutterArchive.zipDirectory(
        sourceDir: dataDir, zipFile: zipFile, recurseSubDirs: true);
  } catch (e) {
    print(e);
  }

Zip files #

  final sourceDir = Directory("source_dir");
  final files = [
    File(sourceDir.path + "file1"),
    File(sourceDir.path + "file2")
  ];
  final zipFile = File("zip_file_path");
  try {
    FlutterArchive.zipFiles(
        sourceDir: sourceDir, files: files, zipFile: zipFile);
  } catch (e) {
    print(e);
  }

Unzip a ZIP archive #

  final zipFile = File("zip_file_path");
  final destinationDir = Directory("destination_dir_path");
  try {
    FlutterArchive.unzip(zipFile: zipFile, destinationDir: destinationDir);
  } catch (e) {
    print(e);
  }
155
likes
0
pub points
98%
popularity

Publisher

verified publisherkineapps.com

Create and extract ZIP archive files in Android and in iOS. Zip all files in a directory recursively or a given list of files.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_archive