file_selector_web
0.9.5, released 6 months ago by flutter.dev
Web implementation of file_selector for selecting files in Flutter web.
What it does
Provides file selection APIs for Flutter web, including openFile, openFiles, getSaveLocation, and mimeType support. It is automatically included when using file_selector and requires no extra pubspec entry.
AI-written summary of version 0.9.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- Selecting files in a Flutter web app
- Need to support cancel event or mimeType on XFile
- Using file_selector as a dependency and want web support automatically
Skip it when
- Using on non-web platforms
- Relying on cancel event in very old browsers
Strengths
- Automatically included via endorsement
- Supports mimeType on XFile
- Handles cancel event for modern browsers
- No extra setup needed
Weaknesses
- Only works on web
- Cancel event support limited to recent browsers
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
import 'package:file_selector/file_selector.dart';
Future<void> pickFile() async {
final XFile? file = await openFile();
if (file != null) {
print('Selected: ${file.path}');
}
}Alternatives
Packages that do the same job and could replace file_selector_web.
- 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_web: ones it builds on, ones built on it, and its own family.
- webfile_selector_web depends on itLightweight bindings for browser APIs via JS interop
- file_selector_linuxSame familyLinux implementation of the file_selector plugin for picking and saving files.
- file_selector_macosSame familymacOS implementation of the file_selector plugin
- file_selector_windowsSame familyWindows implementation of the file_selector plugin
- file_selectorBuilt on file_selector_webFlutter plugin for opening, saving, and selecting directories with native file dialogs