file_selector_macos
0.9.5+2, released 5 weeks ago by flutter.dev
macOS implementation of the file_selector plugin
What it does
Provides APIs to pick files, directories, and save locations on macOS. It implements the platform interface required by file_selector.
AI-written summary of version 0.9.5+2, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need to select files or directories on macOS
- Need to save a file location on macOS
- Using file_selector in a Flutter app targeting macOS
Skip it when
- Using only iOS or Android platforms
- You already have a custom native implementation
Strengths
- Native macOS integration
- Supports entitlements for read/write access
- Keeps up with latest Flutter SDKs
- No extra pubspec dependency needed when using file_selector
Weaknesses
- Only works on macOS
- Requires adding entitlements to the app bundle
- No support for other platforms
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add the entitlement for read-only or read/write access in the macOS project’s Info.plist. No build_runner or codegen required.
import 'package:file_selector/file_selector.dart';
Future<void> pickFile() async {
final XFile? file = await openFile();
if (file != null) {
print('Picked file: ${file.path}');
}
}Alternatives
Packages that do the same job and could replace file_selector_macos.
- filesystem_picker
File and folder picker dialog to browse the device file system.
50Compare - file_picker_web
Web implementation of file_picker for selecting, streaming, and saving files in browsers.
82Compare - image_picker_for_web
Web implementation of image_picker that lets users select images or videos via the browser file picker.
79Compare - flutter_web_file_selector
Select files on the web platform with an iOS UI workaround
38Compare
Works with
Packages commonly used together with file_selector_macos: ones it builds on, ones built on it, and its own family.
- cross_filefile_selector_macos depends on itAn abstraction to allow working with files across multiple platforms.
- file_selector_linuxSame familyLinux implementation of the file_selector plugin for picking and saving files.
- file_selector_webSame familyWeb implementation of file_selector for selecting files in Flutter web.
- file_selector_windowsSame familyWindows implementation of the file_selector plugin
- camera_windowsSame familyWindows implementation of the camera plugin for getting info and controlling cameras
- file_selectorBuilt on file_selector_macosFlutter plugin for opening, saving, and selecting directories with native file dialogs
- image_picker_macosBuilt on file_selector_macosmacOS platform implementation of the image_picker plugin