dir_picker
0.8.0, released 2 weeks ago by v4g.space
Pick directories and list file system entries across Android, iOS, macOS, Windows, Linux, and Web.
What it does
A Flutter plugin providing native system dialogs for directory picking and file system entry listing. It supports streaming large directory trees and persisting access across app restarts via platform-specific features like bookmarks and URI permissions.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need users to pick directories using native system dialogs across desktop, mobile, and web.
- You need to list or stream contents of picked directories recursively.
- You need to maintain access to folders across app restarts using bookmarks or URI permissions.
Skip it when
- You only need to pick individual files rather than directories.
- Your target browser environment is Firefox or Safari on the web, which lack directory picker support.
Strengths
- Cross-platform support including Android, iOS, macOS, Windows, Linux, and Web.
- Supports directory listing and stream-based entry reading for large folders.
- Persistent access handling for picked folders across app restarts.
Weaknesses
- Web platform support is restricted to Chromium browsers (Chrome, Edge) supporting the File System Access API.
- Requires platform-specific setup on macOS (entitlements).
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Requires adding security-scoped bookmark entitlements to macOS Release and DebugProfile entitlements.
import 'package:dir_picker/dir_picker.dart';
final PickedLocation? location = await DirPicker.pick();
if (location != null) {
final entries = await DirPicker.listEntries(location, recursive: true);
for (final entry in entries) {
print('${entry.relativePath}');
}
}Alternatives
Packages that do the same job and could replace dir_picker.
- flutter_file_dialog
Dialogs for picking and saving files and directories on Android and iOS.
90Compare - path_provider
Provides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
93Compare - filepicker_windows
Windows file and directory picker using native dialog controls
75Compare - image_picker_for_web
Web implementation of image_picker that lets users select images or videos via the browser file picker.
79Compare
Works with
Packages commonly used together with dir_picker: ones it builds on, ones built on it, and its own family.
- webdir_picker depends on itLightweight bindings for browser APIs via JS interop
- ffidir_picker depends on itUtilities for working with Foreign Function Interface (FFI) code in Dart.
- jnidir_picker depends on itProvides Dart/Flutter bindings to call native Java code via JNI.
- dbusdir_picker depends on itNative Dart D-Bus client for Linux and Windows.
- file_saver_ffiBuilt on dir_pickerSave any file type to device storage, gallery, or a user‑chosen folder with progress and conflict handling.