open_save_file_dialogs 0.1.1 copy "open_save_file_dialogs: ^0.1.1" to clipboard
open_save_file_dialogs: ^0.1.1 copied to clipboard

PlatformAndroid

A Flutter plugin for opening and saving files on Android, using the native file chooser.

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.

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.

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.

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

0
likes
130
pub points
51%
popularity

Publisher

verified publisherpassion-programmation-laurentdu64.blogspot.com

A Flutter plugin for opening and saving files on Android, using the native file chooser.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on open_save_file_dialogs