directory_picker 0.2.2

Directory Picker #

pub

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.

TODO #

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

[0.2.2]

  • Fixes a bug with permission handling.

[0.2.1]

  • Added a missing dependency to pubspec.yaml.

[0.2.0]

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

[0.1.0]

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

[0.0.1]

  • Adds initial version of directory_picker

example/README.md

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
64
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

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

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
flutter_test