Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## NEXT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed to 1.2.2


* Clarifies that `maxDuration` only applies to video recording and not gallery selection.
* Updates minimum supported SDK version to Flutter 3.32/Dart 3.8.
* Updates README to reflect currently supported OS versions for the latest
versions of the endorsed platform implementations.
Expand Down
9 changes: 7 additions & 2 deletions packages/image_picker/image_picker/lib/image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,13 @@ class ImagePicker {
/// The [source] argument controls where the video comes from. This can
/// be either [ImageSource.camera] or [ImageSource.gallery].
///
/// The [maxDuration] argument specifies the maximum duration of the captured video. If no [maxDuration] is specified,
/// the maximum duration will be infinite.
/// The [maxDuration] argument specifies the maximum duration of the recorded video.
///
/// This parameter only applies when recording a video using the camera.
/// It does not restrict the duration of videos selected from the gallery,
/// since the underlying platform gallery APIs do not support filtering
/// by video duration.
Comment on lines +273 to +278

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The clarification is great! However, the previous documentation mentioned what happens when maxDuration is not specified (it's infinite). This is useful information that has been removed. Consider re-adding it for completeness.

Suggested change
/// The [maxDuration] argument specifies the maximum duration of the recorded video.
///
/// This parameter only applies when recording a video using the camera.
/// It does not restrict the duration of videos selected from the gallery,
/// since the underlying platform gallery APIs do not support filtering
/// by video duration.
/// The [maxDuration] argument specifies the maximum duration of the recorded video.
/// If no [maxDuration] is specified, the maximum duration will be infinite.
///
/// This parameter only applies when recording a video using the camera.
/// It does not restrict the duration of videos selected from the gallery,
/// since the underlying platform gallery APIs do not support filtering
/// by video duration.


///
/// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera].
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image
library, and taking new pictures with the camera.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 1.2.1
version: 1.2.2

environment:
sdk: ^3.8.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ abstract class ImagePickerPlatform extends PlatformInterface {
/// The [source] argument controls where the video comes from. This can
/// be either [ImageSource.camera] or [ImageSource.gallery].
///
/// The [maxDuration] argument specifies the maximum duration of the captured video. If no [maxDuration] is specified,
/// the maximum duration will be infinite.
/// The [maxDuration] argument specifies the maximum duration of the recorded
/// video.
///
/// This parameter only applies when recording a video using the camera.
/// It does not restrict the duration of videos selected from the gallery,
/// since the underlying platform gallery APIs do not support filtering
/// by video duration.

///
/// Use `preferredCameraDevice` to specify the camera to use when the `source` is [ImageSource.camera].
/// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device.
Expand Down