GithubHelp home page GithubHelp logo

chaudharydeepanshu / flutter_file_dialog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kineapps/flutter_file_dialog

1.0 0.0 0.0 106 KB

Dialogs for picking and saving files in Android and in iOS.

Home Page: https://pub.dev/packages/flutter_file_dialog

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

Ruby 3.26% Objective-C 0.81% Kotlin 36.31% Dart 24.83% Swift 34.78%

flutter_file_dialog's Introduction

flutter_file_dialog

Dialogs for picking and saving files in Android and in iOS.

Features

  • Supports Android (API level 19 or later) and iOS (10.0 or later).
  • Modern plugin implementation based on Kotlin (Android) and Swift (iOS).
  • Pick image files and other documents.
  • Save a file to a selected location.
  • iOS dialog types: document and image.
  • iOS source types: camera, photo library, saved photos album.
  • Allow user to edit picked image in iOS.
  • Set file extension filter and mime types filter when picking a document.
  • Possibility to limit picking a file from the local device only (Android).

Examples

Pick an image file

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

Pick a document

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

Save a file

final params = SaveFileDialogParams(sourceFilePath: "path_of_file_to_save");
final filePath = await FlutterFileDialog.saveFile(params: params);
print(filePath);

Optimize picked image file using flutter_image_utilities

Use the plugin flutter_image_utilities to optimize a picked image file.

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

  if (filePath != null) {
    final pickedFile = File(filePath)

    // optimize the image file
    final optimizedFile = await FlutterImageUtilities.saveAsJpeg(
      sourceFile: pickedFile,
      quality: 60,
      maxWidth: 1920,
      maxHeight: 1024,
    );
  }

flutter_file_dialog's People

Contributors

kinex avatar allanwolski avatar hacker1024 avatar hygehyge avatar richardbushnell avatar

Stargazers

Roman 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.