ImagePickerPlugin class

The web implementation of ImagePickerPlatform.

This class implements the package:image_picker functionality for the web.

Inheritance
  • Object
  • PlatformInterface
  • ImagePickerPlugin

Constructors

ImagePickerPlugin({@visibleForTesting ImagePickerPluginTestOverrides? overrides, @visibleForTesting ImageResizer? imageResizer})
A constructor that allows tests to override the function that creates file inputs.

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

computeCaptureAttribute(ImageSource source, CameraDevice device) String?
Converts plugin configuration into a proper value for the capture attribute.
createInputElement(String? accept, String? capture, {bool multiple = false}) Element
Creates an input element that accepts certain file types, and allows to capture from the device's cameras (where supported)
getFiles({String? accept, String? capture, bool multiple = false}) Future<List<XFile>>
Injects a file input with the specified accept+capture attributes, and returns a list of XFile that the user selected locally.
getImage({required ImageSource source, double? maxWidth, double? maxHeight, int? imageQuality, CameraDevice preferredCameraDevice = CameraDevice.rear}) Future<XFile>
Returns an XFile with the image that was picked.
getLostData() Future<LostDataResponse>
Retrieves any previously picked files, that were lost due to the MainActivity being destroyed. (Android only)
inherited
getMultiImage({double? maxWidth, double? maxHeight, int? imageQuality, int? count}) Future<List<XFile>>
Injects a file input, and returns a list of XFile that the user selected locally.
getVideo({required ImageSource source, CameraDevice preferredCameraDevice = CameraDevice.rear, Duration? maxDuration}) Future<XFile>
Returns an XFile containing the video that was picked.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pickFile({String? accept, String? capture}) Future<PickedFile>
Injects a file input with the specified accept+capture attributes, and returns the PickedFile that the user selected locally.
pickImage({required ImageSource source, double? maxWidth, double? maxHeight, int? imageQuality, CameraDevice preferredCameraDevice = CameraDevice.rear}) Future<PickedFile>
Returns a PickedFile with the image that was picked.
pickMultiImage({double? maxWidth, double? maxHeight, int? imageQuality, int? count}) Future<List<PickedFile>?>
Returns a List<PickedFile> with the images that were picked.
inherited
pickVideo({required ImageSource source, CameraDevice preferredCameraDevice = CameraDevice.rear, Duration? maxDuration}) Future<PickedFile>
Returns a PickedFile containing the video that was picked.
retrieveLostData() Future<LostData>
Retrieves any previously picked file, that was lost due to the MainActivity being destroyed. In case multiple files were lost, only the last file will be recovered. (Android only).
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

registerWith(Registrar registrar) → void
Registers this class as the default instance of ImagePickerPlatform.