You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin now covers all of our supported platforms, most highly-requested features have been addressed, and the API has been stable for quite some time (in that no breaking changes have been required). Given that, a 1.0 version number reflects the current state of the package than a 0.x version.
As part of the breaking change, the `get*` methods that were deprecated several years ago have now been removed.
/// Returns a [PickedFile] object wrapping the image that was picked.
29
-
///
30
-
/// The returned [PickedFile] is intended to be used within a single app session. Do not save the file path and use it across sessions.
31
-
///
32
-
/// The `source` argument controls where the image comes from. This can
33
-
/// be either [ImageSource.camera] or [ImageSource.gallery].
34
-
///
35
-
/// Where iOS supports HEIC images, Android 8 and below doesn't. Android 9 and above only support HEIC images if used
36
-
/// in addition to a size modification, of which the usage is explained below.
37
-
///
38
-
/// If specified, the image will be at most `maxWidth` wide and
39
-
/// `maxHeight` tall. Otherwise the image will be returned at it's
40
-
/// original width and height.
41
-
/// The `imageQuality` argument modifies the quality of the image, ranging from 0-100
42
-
/// where 100 is the original/max quality. If `imageQuality` is null, the image with
43
-
/// the original quality will be returned. Compression is only supported for certain
44
-
/// image types such as JPEG and on Android PNG and WebP, too. If compression is not supported for the image that is picked,
45
-
/// a warning message will be logged.
46
-
///
47
-
/// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera].
48
-
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
49
-
/// Defaults to [CameraDevice.rear]. Note that Android has no documented parameter for an intent to specify if
50
-
/// the front or rear camera should be opened, this function is not guaranteed
51
-
/// to work on an Android device.
52
-
///
53
-
/// In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost
54
-
/// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data.
55
-
///
56
-
/// See also [getMultiImage] to allow users to select multiple images at once.
57
-
///
58
-
/// The method could throw [PlatformException] if the app does not have permission to access
59
-
/// the camera or photos gallery, no camera is available, plugin is already in use,
60
-
/// temporary file could not be created (iOS only), plugin activity could not
61
-
/// be allocated (Android only) or due to an unknown error.
/// Returns a [List<PickedFile>] object wrapping the images that were picked.
80
-
///
81
-
/// The returned [List<PickedFile>] is intended to be used within a single app session. Do not save the file path and use it across sessions.
82
-
///
83
-
/// Where iOS supports HEIC images, Android 8 and below doesn't. Android 9 and above only support HEIC images if used
84
-
/// in addition to a size modification, of which the usage is explained below.
85
-
///
86
-
/// This method is not supported in iOS versions lower than 14.
87
-
///
88
-
/// If specified, the images will be at most `maxWidth` wide and
89
-
/// `maxHeight` tall. Otherwise the images will be returned at it's
90
-
/// original width and height.
91
-
/// The `imageQuality` argument modifies the quality of the images, ranging from 0-100
92
-
/// where 100 is the original/max quality. If `imageQuality` is null, the images with
93
-
/// the original quality will be returned. Compression is only supported for certain
94
-
/// image types such as JPEG and on Android PNG and WebP, too. If compression is not supported for the image that is picked,
95
-
/// a warning message will be logged.
96
-
///
97
-
/// The method could throw [PlatformException] if the app does not have permission to access
98
-
/// the camera or photos gallery, no camera is available, plugin is already in use,
99
-
/// temporary file could not be created (iOS only), plugin activity could not
100
-
/// be allocated (Android only) or due to an unknown error.
101
-
///
102
-
/// See also [getImage] to allow users to only pick a single image.
103
-
@Deprecated('Switch to using pickMultiImage instead')
104
-
Future<List<PickedFile>?> getMultiImage({
105
-
double? maxWidth,
106
-
double? maxHeight,
107
-
int? imageQuality,
108
-
}) {
109
-
return platform.pickMultiImage(
110
-
maxWidth: maxWidth,
111
-
maxHeight: maxHeight,
112
-
imageQuality: imageQuality,
113
-
);
114
-
}
115
-
116
-
/// Returns a [PickedFile] object wrapping the video that was picked.
117
-
///
118
-
/// The returned [PickedFile] is intended to be used within a single app session. Do not save the file path and use it across sessions.
119
-
///
120
-
/// The [source] argument controls where the video comes from. This can
121
-
/// be either [ImageSource.camera] or [ImageSource.gallery].
122
-
///
123
-
/// The [maxDuration] argument specifies the maximum duration of the captured video. If no [maxDuration] is specified,
124
-
/// the maximum duration will be infinite.
125
-
///
126
-
/// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera].
127
-
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
128
-
/// Defaults to [CameraDevice.rear].
129
-
///
130
-
/// In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost
131
-
/// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data.
132
-
///
133
-
/// The method could throw [PlatformException] if the app does not have permission to access
134
-
/// the camera or photos gallery, no camera is available, plugin is already in use,
135
-
/// temporary file could not be created and video could not be cached (iOS only),
136
-
/// plugin activity could not be allocated (Android only) or due to an unknown error.
/// Retrieve the lost [PickedFile] when [selectImage] or [selectVideo] failed because the MainActivity is destroyed. (Android only)
152
-
///
153
-
/// Image or video can be lost if the MainActivity is destroyed. And there is no guarantee that the MainActivity is always alive.
154
-
/// Call this method to retrieve the lost data and process the data according to your app's business logic.
155
-
///
156
-
/// Returns a [LostData] object if successfully retrieved the lost data. The [LostData] object can represent either a
157
-
/// successful image/video selection, or a failure.
158
-
///
159
-
/// Calling this on a non-Android platform will throw [UnimplementedError] exception.
160
-
///
161
-
/// See also:
162
-
/// * [LostData], for what's included in the response.
163
-
/// * [Android Activity Lifecycle](https://developer.android.com/reference/android/app/Activity.html), for more information on MainActivity destruction.
164
-
@Deprecated('Switch to using retrieveLostData instead')
165
-
Future<LostData> getLostData() {
166
-
return platform.retrieveLostData();
167
-
}
168
-
169
28
/// Returns an [XFile] object wrapping the image that was picked.
170
29
///
171
-
/// The returned [XFile] is intended to be used within a single app session. Do not save the file path and use it across sessions.
30
+
/// The returned [XFile] is intended to be used within a single app session.
31
+
/// Do not save the file path and use it across sessions.
172
32
///
173
33
/// The `source` argument controls where the image comes from. This can
174
34
/// be either [ImageSource.camera] or [ImageSource.gallery].
@@ -234,7 +94,8 @@ class ImagePicker {
234
94
235
95
/// Returns a [List<XFile>] object wrapping the images that were picked.
236
96
///
237
-
/// The returned [List<XFile>] is intended to be used within a single app session. Do not save the file path and use it across sessions.
97
+
/// The returned [List<XFile>] is intended to be used within a single app session.
98
+
/// Do not save the file path and use it across sessions.
238
99
///
239
100
/// Where iOS supports HEIC images, Android 8 and below doesn't. Android 9 and above only support HEIC images if used
240
101
/// in addition to a size modification, of which the usage is explained below.
@@ -284,7 +145,8 @@ class ImagePicker {
284
145
}
285
146
286
147
/// Returns an [XFile] of the image or video that was picked.
287
-
/// The image or videos can only come from the gallery.
148
+
///
149
+
/// The image or video can only come from the gallery.
288
150
///
289
151
/// The returned [XFile] is intended to be used within a single app session.
290
152
/// Do not save the file path and use it across sessions.
@@ -339,6 +201,7 @@ class ImagePicker {
339
201
}
340
202
341
203
/// Returns a [List<XFile>] with the images and/or videos that were picked.
204
+
///
342
205
/// The images and videos come from the gallery.
343
206
///
344
207
/// The returned [List<XFile>] is intended to be used within a single app session.
0 commit comments