pick_or_save 0.0.6 copy "pick_or_save: ^0.0.6" to clipboard
pick_or_save: ^0.0.6 copied to clipboard

outdated

A Flutter file picking and saving package that enables you to pick or save a single file and multiple files.

pub package

Package description #

A Flutter file picking and saving package that enables you to pick or save a single file and multiple files.

Note: Although this package supports picking and caching files by default to work with them in flutter, it is actually built for those who manage files natively in android as this package supports disabling copying of file in cache to work with Android URIs directly.

Features #

  • Works on Android 5.0 (API level 21) or later.
  • Pick single file or multiple files.
  • Get meta data like name, size and last modified for files.
  • Saves single file while allowing user to choose location and name.
  • Saves multiple file while allowing user to choose location or directory for saving all files.
  • Saves file from either file path or file data.
  • Filter extensions when picking a document.
  • Could limit picking a file from the local device only.

Getting started #

  • In pubspec.yaml, add this dependency:
pick_or_save: 
  • Add this package to your project:
import 'package:pick_or_save/pick_or_save.dart';

Basic Usage #

Picking single file #

List<String>? result = await PickOrSave().filePicker(
  params: FilePickerParams(),
);
String filePath = result[0];

Note: Setting copyFileToCacheDir = false will provide uri path which can only be used in android native platform.

Picking multiple files #

List<String>? filesPaths = await PickOrSave().filePicker(
  params: FilePickerParams(filePickingType: FilePickingType.multiple),
);

Note: Setting copyFileToCacheDir = false will provide uri paths which can only be used in android native platform.

Picking multiple files #

List<String>? filesPaths = await PickOrSave().filePicker(
  params: FilePickerParams(filePickingType: FilePickingType.multiple),
);

Saving single file #

List<String>? result = await PickOrSave().fileSaver(
  params: FileSaverParams(
    sourceFilesPaths: [filePath],
    filesNames: ["file.png"],
  ),
);
String savedFilePath = result[0];

Saving multiple files #

List<String>? savedFilesPaths = await PickOrSave().fileSaver(
  params: FileSaverParams(
    sourceFilesPaths: [file1Path, file2Path],
    filesNames: ["file 1.png, file 2.png"],
  ),
);
Saving single file Saving multiple files
WhatsApp Image 2022-09-19 at 1 34 02 PM WhatsApp Image 2022-09-19 at 1 33 04 PM

File Metadata #

FileMetadata result = await PickOrSave().fileMetaData(
  params: FileMetadataParams(sourceFileUri: fileUri),
);
35
likes
0
pub points
86%
popularity

Publisher

verified publisherdeepanshuchaudhary.com

A Flutter file picking and saving package that enables you to pick or save a single file and multiple files.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on pick_or_save