Skip to content

Commit 56d3ca1

Browse files
author
Chris Yang
committed
update api
1 parent ef42308 commit 56d3ca1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/image_picker/image_picker/lib/image_picker.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ class ImagePicker {
9191
/// the front or rear camera should be opened, this function is not guaranteed
9292
/// to work on an Android device.
9393
///
94+
/// Use `forceFullMetaData` to force retrieve the full meta data of the content picked. Defaults to `true`
95+
/// Some platforms require less permissions for getting images/videos without their full metadata,
96+
/// when this flag is false the plugin fetches the image in a way that requires minimal extra permissions
97+
/// from the platform (e.g on iOS the plugin won’t ask for the XXX permission).
98+
/// When this flag is true the plugin tries to get the full image/video metadata which may prompt extra permission requests.
99+
///
94100
/// In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost
95101
/// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data.
96102
Future<PickedFile> getImage({
@@ -99,6 +105,7 @@ class ImagePicker {
99105
double maxHeight,
100106
int imageQuality,
101107
CameraDevice preferredCameraDevice = CameraDevice.rear,
108+
bool forceFullMetaData = true,
102109
}) {
103110
return platform.pickImage(
104111
source: source,
@@ -153,12 +160,19 @@ class ImagePicker {
153160
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
154161
/// Defaults to [CameraDevice.rear].
155162
///
163+
/// Use `forceFullMetaData` to force retrieve the full meta data of the content picked. Defaults to `true`
164+
/// Some platforms require less permissions for getting images/videos without their full metadata,
165+
/// when this flag is false the plugin fetches the image in a way that requires minimal extra permissions
166+
/// from the platform (e.g on iOS the plugin won’t ask for the XXX permission).
167+
/// When this flag is true the plugin tries to get the full image/video metadata which may prompt extra permission requests.
168+
///
156169
/// In Android, the MainActivity can be destroyed for various fo reasons. If that happens, the result will be lost
157170
/// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data.
158171
Future<PickedFile> getVideo({
159172
@required ImageSource source,
160173
CameraDevice preferredCameraDevice = CameraDevice.rear,
161174
Duration maxDuration,
175+
bool forceFullMetaData = true,
162176
}) {
163177
return platform.pickVideo(
164178
source: source,

0 commit comments

Comments
 (0)