Reputation: 117
How to zip files from list?
Path of my list:
files[index].path;
Flutter archive package code:
final sourceDir = Directory("source_dir");
final files = [
File(sourceDir.path + "file1"),
File(sourceDir.path + "file2")
];
final zipFile = File("zip_file_path");
try {
ZipFile.createFromFiles(
sourceDir: sourceDir, files: files, zipFile: zipFile);
} catch (e) {
print(e);
}
Upvotes: 0
Views: 394
Reputation: 247
By using this package flutter_archive: ^5.0.0 you can zip file after getting files from storage
Upvotes: 2