A Flutter plugin designed to create and extract files from zip files. Currently, this plugin only includes the android APIs.
dependencies:
flutter:
sdk: flutter
flutter_zipper_basic:
git:
url: [email protected]:etrigan21/flutter_basic_zipper.git
ref: main # branch name
The following is used to create a regular zip file.
FlutterZipperBasic.createZip(
files: [file1, file2, file3],
zipPath: zipPath)
In order to create password protected zip files, add the following parameters
FlutterZipperBasic.createZip(
files: [file1, file, file3],
zipPath: zipPath
isPasswordProtected: true,
password: "String password"
)
To listen to the percent completion of the zipping process, add the following params
FlutterZipperBasic.createZip(
files: [file1, file, file3],
zipPath: zipPath
isPasswordProtected: true,
password: "String password"
getPercentage: (value){}
)
To create a split zip file, use the following:
FlutterZipperBasic.createSplitZip(
files: fileList,
zipPath: externalStorage + "/test.zip",
);
To add password to the zip file
FlutterZipperBasic.createSplitZip(
files: fileList,
isPasswordProtected: true
password: "String password",
zipPath: externalStorage + "/test.zip",
);
To listen for percent progression:
FlutterZipperBasic.createSplitZip(
files: fileList,
isPasswordProtected: true
password: "String password",
zipPath: externalStorage + "/test.zip",
getPercentage: (value) {
print(value);
}
);
FlutterZipperBasic.extractAll(
destination: "Zip file directory",
zipPath: "zip file directory",
getPercentage: (values){
//handle percent value
});
- Create a better example
- Update functionalities