pick_or_save 0.0.3 pick_or_save: ^0.0.3 copied to clipboard
A Flutter file picking and saving package that enables you to pick or save a single file and multiple files.
Package description #
A Flutter file picking and saving package that enables you to pick or save a single file and multiple files.
Features #
- Works on Android 5.0 (API level 21) or later.
- Pick single file or multiple 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];
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 |
---|---|