image_picker_for_web
3.1.1, released a year ago by flutter.dev
Web implementation of image_picker that lets users select images or videos via the browser file picker.
What it does
Provides the same API as the image_picker package for the web platform. It returns XFile objects that contain Blob URLs or byte data. Supports image and video selection with optional resize/quality parameters where applicable.
AI-written summary of version 3.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to pick images or videos on Flutter web using the familiar image_picker API.
- You want a single package that works across mobile and web without extra code.
Skip it when
- You require precise control over image resizing for GIFs or need maxDuration for video capture.
- You need guaranteed capture behavior across all browsers.
Strengths
- Seamless API compatibility with image_picker
- Handles XFile abstraction and Blob URLs automatically
- Supports multi‑video selection and recent browser features
Weaknesses
- Resize/quality options limited for GIFs and only affect JPG/WEBP
- maxDuration not supported for videos on web
- Behavior depends on browser support for input attributes
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:image_picker/image_picker.dart';
final picker = ImagePicker();
final XFile? file = await picker.pickImage(source: ImageSource.gallery);
if (file != null) {
final image = kIsWeb ? Image.network(file.path) : Image.file(File(file.path));
}Alternatives
Packages that do the same job and could replace image_picker_for_web.
- file_selector_macos
macOS implementation of the file_selector plugin
82Compare - file_selector_windows
Windows implementation of the file_selector plugin
77Compare - file_selector_web
Web implementation of file_selector for selecting files in Flutter web.
76Compare - file_picker_web
Web implementation of file_picker for selecting, streaming, and saving files in browsers.
82Compare
Works with
Packages commonly used together with image_picker_for_web: ones it builds on, ones built on it, and its own family.
- mimeimage_picker_for_web depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- webimage_picker_for_web depends on itLightweight bindings for browser APIs via JS interop
- image_picker_windowsSame familyWindows implementation of image_picker for selecting images and videos
- image_picker_iosSame familyiOS implementation of the image_picker plugin.
- image_picker_macosSame familymacOS platform implementation of the image_picker plugin
- image_picker_androidSame familyAndroid implementation of the image_picker plugin for selecting photos and videos.
- image_pickerBuilt on image_picker_for_webFlutter plugin for selecting images/videos from the gallery and capturing new ones via camera.