file_selector
1.1.0, released 12 months ago by flutter.dev
Flutter plugin for opening, saving, and selecting directories with native file dialogs
What it does
Provides APIs to open single or multiple files, get save locations, and pick directories across Android, iOS, macOS, Linux, Windows, and Web. It uses platform-specific implementations to show native file pickers.
AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need to let users pick files or directories in a Flutter app
- Require cross-platform file selection without custom UI
- Need to save files to user-selected locations
Skip it when
- You only need to read/write files programmatically without user interaction
- You need advanced file system monitoring or watching
Strengths
- Cross-platform native dialogs
- Supports filtering by extensions, MIME types, and UTIs
- Offers directory selection and save location APIs
- Regularly updated with SDK support changes
Weaknesses
- No support for iOS <12 or Android <SDK21
- Requires platform-specific entitlements on macOS
- No built-in file watching or monitoring
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 7
Add platform-specific entitlements on macOS for read/write access; include plugin in pubspec; no build_runner needed
final XFile? file = await openFile(acceptedTypeGroups: [XTypeGroup(label: 'images', extensions: ['jpg','png'])]);Alternatives
Packages that do the same job and could replace file_selector.
- file_picker
Provides similar file selection but with different API surface and may support more platforms
93Compare - path_provider
Useful for getting platform directories but does not provide file dialogs
93Compare
Works with
Packages commonly used together with file_selector: ones it builds on, ones built on it, and its own family.
- file_selector_linuxfile_selector depends on itLinux implementation of the file_selector plugin for picking and saving files.
- file_selector_macosfile_selector depends on itmacOS implementation of the file_selector plugin
- file_selector_webfile_selector depends on itWeb implementation of file_selector for selecting files in Flutter web.
- file_selector_windowsfile_selector depends on itWindows implementation of the file_selector plugin
- image_picker_windowsSame familyWindows implementation of image_picker for selecting images and videos
- image_picker_macosSame familymacOS platform implementation of the image_picker plugin
- stream_chat_flutterBuilt on file_selectorFull-featured Flutter UI SDK for Stream Chat, providing ready‑made chat widgets and theming.
- flutter_ai_toolkitBuilt on file_selectorAI chat widgets and LLM provider integration for Flutter apps.