GithubHelp home page GithubHelp logo

etrigan21 / flutter_basic_zipper Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 313 KB

A flutter plugin designed for the creation and extraction of zip files.

License: BSD 3-Clause "New" or "Revised" License

Java 18.29% Dart 10.02% Swift 4.44% Objective-C 0.04% CMake 28.07% C++ 34.06% C 3.29% Ruby 1.79%

flutter_basic_zipper's Introduction

flutter_zipper_basic

A Flutter plugin designed to create and extract files from zip files. Currently, this plugin only includes the android APIs.

Getting Started

Installing the plugin to your pubspec.yaml

dependencies:
  flutter:
    sdk: flutter

  flutter_zipper_basic:
    git:
      url: [email protected]:etrigan21/flutter_basic_zipper.git
      ref: main # branch name

Creation of zip files

1. Creating zip file

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){}
    )

2. Creating a split zip file

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);
    }
);

3. Extract zip file content

FlutterZipperBasic.extractAll(
    destination: "Zip file directory", 
    zipPath: "zip file directory", 
    getPercentage: (values){
        //handle percent value
    });

ToDo:

  1. Create a better example
  2. Update functionalities

flutter_basic_zipper's People

Contributors

etrigan21 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.