ImagePicker class

Provides an easy way to pick an image/video from the image library, or to take a picture/video with the camera.

Constructors

ImagePicker()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getImage({required ImageSource source, double? maxWidth, double? maxHeight, int? imageQuality, CameraDevice preferredCameraDevice = CameraDevice.rear}) Future<PickedFile?>
Returns a PickedFile object wrapping the image that was picked.
getLostData() Future<LostData>
Retrieve the lost PickedFile when selectImage or selectVideo failed because the MainActivity is destroyed. (Android only)
getMultiImage({double? maxWidth, double? maxHeight, int? imageQuality, int? count}) Future<List<PickedFile>?>
Returns a List<PickedFile> object wrapping the images that were picked.
getVideo({required ImageSource source, CameraDevice preferredCameraDevice = CameraDevice.rear, Duration? maxDuration}) Future<PickedFile?>
Returns a PickedFile object wrapping the video that was picked.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pickImage({required ImageSource source, double? maxWidth, double? maxHeight, int? imageQuality, CameraDevice preferredCameraDevice = CameraDevice.rear}) Future<XFile?>
Returns an XFile object wrapping the image that was picked.
pickMultiImage({double? maxWidth, double? maxHeight, int? imageQuality, int? count}) Future<List<XFile>?>
Returns a List<XFile> object wrapping the images that were picked.
pickVideo({required ImageSource source, CameraDevice preferredCameraDevice = CameraDevice.rear, Duration? maxDuration}) Future<XFile?>
Returns an XFile object wrapping the video that was picked.
retrieveLostData() Future<LostDataResponse>
Retrieve the lost XFile when pickImage, pickMultiImage or pickVideo failed because the MainActivity is destroyed. (Android only)
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

platform → ImagePickerPlatform
The platform interface that drives this plugin
no setter