file_picker_writable 2.1.0+1 copy "file_picker_writable: ^2.1.0+1" to clipboard
file_picker_writable: ^2.1.0+1 copied to clipboard

Flutter plugin to allow users to open files/documents which can be read, and written back at a later time as well as creating new files on external media.

Pub Version

file_picker_writable #

Flutter plugin to choose files which can be read, referenced and written back at a later time (persistent permissions on android, secure bookmarks on iOS).

It also offers handlers for open intents when the user wants to open associated files from other apps. In the same way it will also handle arbitrary URLs and pass them back to dart.

Requirements #

iOS #

  • iOS 8 + Swift 5
  • Only tested on iOS 13+, so let me know ;-)

Support for file handlers #

  1. Configure an OTI Type:
  2. Add to plist file:

Android #

Support for file handlers #


                <action android:name="android.intent.action.VIEW"  />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="file" />
                <data android:scheme="content" />
                <data android:host="*"  />
                <data android:mimeType="*/*" />
                <!-- ?? -->
                <data android:pathPattern=".*\\.codeux" />
                <data android:pathPattern=".*\\..*\\.codeux" />
                <data android:pathPattern=".*\\..*\\..*\\.codeux" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.codeux" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.codeux" />
                <data android:pathPattern=".*\\..*\\..*\\..*\\.*\\..*\\.codeux" />

MacOS #

Is currently not supported. The only thing the plugin will do is listen for URL Events and pass them through to the dart side.

Getting Started #

See the example on how to implement it in a simple application.

Future<void> readFile() async {
  final fileInfo = await FilePickerWritable().openFile((fileInfo, file) async {
    _logger.fine('Got picker result: $fileInfo');

    // now do something useful with the selected file...'Got file contents in temporary file: $file');'fileName: ${fileInfo.fileName}');'Identifier which can be persisted for later retrieval:'
    return fileInfo;
  if (fileInfo == null) {'User canceled.');

The returned fileInfo.identifier can be used later to write or read from the data, even after an app restart.

Future<void> persistChanges(FileInfo fileInfo, Uint8List newContent) async {
  // tell FilePickerWritable plugin to write the new contents over the user selected file
  await FilePickerWritable().writeFile(
      identifier: fileInfo.identifier,
      writer: (file) async {
        // write new content into the temporary file.
        await file.writeBytes(newContent);

Create a new file by letting the user choose a directory and file name:

final rand = Random().nextInt(10000000);
final fileInfo = await FilePickerWritable().openFileForCreate(
  fileName: 'newfile.$rand.codeux',
  writer: (file) async {
    final content = 'File created at ${}\n\n';
    await file.writeAsString(content);
if (fileInfo == null) {'User canceled.');
final data = await;
    .save(data.copyWith(files: data.files + [fileInfo]));

This will open the following screen on Android:

create file screenshot

pub points



Flutter plugin to allow users to open files/documents which can be read, and written back at a later time as well as creating new files on external media.

Repository (GitHub)
View/report issues


API reference


MIT (license)


convert, flutter, logging, path, path_provider, quiver, synchronized


Packages that depend on file_picker_writable