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
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
orselectVideo
failed because the MainActivity is destroyed. (Android only) -
getMultiImage(
{double? maxWidth, double? maxHeight, int? imageQuality}) → 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, bool requestFullMetadata = true}) → Future< XFile?> - Returns an XFile object wrapping the image that was picked.
-
pickMedia(
{double? maxWidth, double? maxHeight, int? imageQuality, bool requestFullMetadata = true}) → Future< XFile?> - Returns an XFile of the image or video that was picked. The image or videos can only come from the gallery.
-
pickMultiImage(
{double? maxWidth, double? maxHeight, int? imageQuality, bool requestFullMetadata = true}) → Future< List< XFile> > - Returns a List<XFile> object wrapping the images that were picked.
-
pickMultipleMedia(
{double? maxWidth, double? maxHeight, int? imageQuality, bool requestFullMetadata = true}) → Future< List< XFile> > - Returns a List<XFile> with the images and/or videos that were picked. The images and videos come from the gallery.
-
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)
-
supportsImageSource(
ImageSource source) → bool -
Returns true if the current platform implementation supports
source
. -
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