directory_picker 0.2.2

Directory Picker #


A flutter package to pick directories and handles requesting required permissions as well. This package only supports android.

Picker Screenshot

Installation #

Add below line to your pubspec.yaml and run flutter packages get

directory_picker: ^0.2.2

Permissions #

Add below line to your android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

If you want to allow creating new folders directly from picker then add the below permission also

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Usage #

import 'package:directory_picker/directory_picker.dart';
import 'package:path_provider/path_provider.dart';

// In any callback call the below method 
Directory newDirectory = await DirectoryPicker.pick(
  context: context,
  rootDirectory: directory

if (newDirectory != null) {
  // Do something with the picked directory
} else {
  // User cancelled without picking any directory

See example app for more detailed usage.


  • [ ] Make rootDirectory optional.
  • [ ] Better levels of customisation for picker dialog.


  • Fixes a bug with permission handling.


  • Added a missing dependency to pubspec.yaml.


  • Now new folders can be created directly from directory picker. Enable it by passing allowFolderCreation = true to the picker.


  • Fixes typo in README
  • Code formatted and version bump to release.


  • Adds initial version of directory_picker


Directory Picker Example #

This example shows how to use directory_picker plugin.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  directory_picker: ^0.2.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:directory_picker/directory_picker.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Aug 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
path ^1.6.2 1.6.4
simple_permissions ^0.1.9 0.1.9
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies