https://github.com/loloof64/flutter_open_save_file_dialogs
A Flutter plugin for opening and saving files on Android.
https://github.com/loloof64/flutter_open_save_file_dialogs
android filechooser flutter plugin
Last synced: 21 days ago
JSON representation
A Flutter plugin for opening and saving files on Android.
- Host: GitHub
- URL: https://github.com/loloof64/flutter_open_save_file_dialogs
- Owner: loloof64
- License: mit
- Created: 2023-12-06T18:32:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-01T11:40:20.000Z (3 months ago)
- Last Synced: 2025-04-01T12:32:06.680Z (3 months ago)
- Topics: android, filechooser, flutter, plugin
- Language: Dart
- Homepage:
- Size: 104 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# open save file dialog
A Flutter plugin for opening and saving files on Android, using native file chooser.
### Dialogs
#### Select a file for saving
Call the async method `saveFileDialog`, where you pass a String for the new file content, and you can pass a String for the named parameter `startingFileName` if you want.
Throws an exception if the content could not be saved.
You get the saved file name as a String(you could get another name if the selected name is already taken by another file and you don't select it for rewriting), or null if no file was selected.
```dart
import 'package:open_save_file_dialogs/open_save_file_dialogs.dart';
...
final _openSaveFileDialogsPlugin = OpenSaveFileDialogs();
...
final newFileName = await _openSaveFileDialogsPlugin.saveFileDialog(content: myTextContent, startingFileName: "test.txt");
```#### Select a file for opening
Call the async method `openFileDialog`.
You get the selected file content as a String, or null if no file was selected.Throws an exception if the content could not be read.
```dart
import 'package:open_save_file_dialogs/open_save_file_dialogs.dart';
...
final _openSaveFileDialogsPlugin = OpenSaveFileDialogs();
...
final path = await _openSaveFileDialogsPlugin.openFileDialog();
```## For developers
### Updating native code
If needed, run
```dart run pigeon --input pigeon/native_communication.dart```
in order to update generated native code