file_picker
13.4.0, released 4 days ago by victorcarreras.dev
Use the native file explorer to pick single or multiple files, directories, and save files.
What it does
A federated Flutter plugin that opens the native OS file explorer to select single or multiple files, pick directories, or trigger save-file dialogs. It supports custom extension filtering, cloud files, and retrieving files as XFiles or reading their bytes directly.
AI-written summary of version 13.3.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- Your app needs to let users pick single or multiple files using native platform dialogs.
- You need to allow users to select directories or save files to specific paths.
- You require extension filtering for specific file types like images, videos, or custom formats.
Skip it when
- You need an internal custom-designed UI asset browser rather than the OS native file explorer.
- You are handling web-specific features where browser restrictions prevent accessing full filesystem details.
Strengths
- Supports all major platforms including mobile, web, desktop, and WebAssembly.
- Provides access to native file explorers and cloud storage integration.
- Offers integration with cross_file for interoperability with other libraries.
Weaknesses
- Web and mobile platform limitations apply regarding direct file path exposure and filesystem access.
- Certain advanced options and dialog configurations require platform-specific option objects.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Requires platform-specific configuration for certain features like macOS entitlements or Android recovery options as documented in the respective platform packages.
PlatformFile? file = await FilePicker.pickFile();
if (file != null) {
print(file.name);
print(await file.length());
} else {
// User canceled the picker
}Alternatives
Packages that do the same job and could replace file_picker.
- path_provider_android
Android implementation of the path_provider plugin for finding commonly used locations.
79Compare - path_provider_foundation
iOS/macOS implementation of path_provider using direct FFI calls
78Compare - image_picker_for_web
Web implementation of image_picker that lets users select images or videos via the browser file picker.
79Compare - path_provider_windows
Windows implementation of the path_provider plugin
50Compare
Works with
Packages commonly used together with file_picker: ones it builds on, ones built on it, and its own family.
- file_picker_webfile_picker depends on itWeb implementation of file_picker for selecting, streaming, and saving files in browsers.
- file_picker_platform_interfacefile_picker depends on itCommon platform interface for the file_picker federated plugin.
- cross_filefile_picker depends on itAn abstraction to allow working with files across multiple platforms.
- file_magic_numberSame familyDetect file types based on content headers and magic numbers across platforms.
- stream_chat_flutterBuilt on file_pickerFull-featured Flutter UI SDK for Stream Chat, providing ready‑made chat widgets and theming.
- html_editor_enhancedBuilt on file_pickerHTML rich text editor for Android, iOS, and Web using the Summernote library
- serverpod_auth_shared_flutterBuilt on file_pickerShared Flutter widgets for Serverpod authentication, including passwordless OTP and social logins.
- zego_uikitBuilt on file_pickerPre-built voice and video calling UI components and low-code integration.