-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[image_picker] Clarify maxDuration parameter behavior #10473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -271,8 +271,14 @@ 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 captured video when recording | ||
| /// from the camera ([ImageSource.camera]). The recording will automatically stop when this duration | ||
| /// is reached. If no [maxDuration] is specified, the maximum duration will be infinite. | ||
| /// | ||
| /// **Important:** The [maxDuration] parameter is ignored when selecting videos from the gallery | ||
| /// ([ImageSource.gallery]). Users can select videos of any duration from the gallery, regardless | ||
| /// of the [maxDuration] value. If you need to enforce duration limits on gallery-selected videos, | ||
| /// you must validate the video duration programmatically after selection. | ||
777genius marked this conversation as resolved.
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't need to be an whole extra paragraph, it should just be noted in the paragraph that documents the parameter. E.g., "The [maxDuration] argument specifies the maximum duration of the captured video when recording from the camera ([ImageSource.camera]), and is ignored for [ImageSource.gallery]." |
||
| /// | ||
| /// 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. | ||
|
|
@@ -305,9 +311,13 @@ class ImagePicker { | |
| /// | ||
| /// The videos come from the gallery. | ||
| /// | ||
| /// The [maxDuration] argument specifies the maximum duration of the captured | ||
| /// videos. If no [maxDuration] is specified, the maximum duration will be | ||
| /// infinite. This value may be ignored by platforms that cannot support it. | ||
| /// The [maxDuration] argument specifies the maximum duration of the videos. | ||
| /// If no [maxDuration] is specified, the maximum duration will be infinite. | ||
| /// | ||
| /// **Important:** This method only picks videos from the gallery. The [maxDuration] | ||
| /// parameter is ignored and users can select videos of any duration. If you need | ||
| /// to enforce duration limits, you must validate the video durations programmatically | ||
| /// after selection. | ||
| /// | ||
| /// The `limit` parameter modifies the maximum number of videos that can be | ||
| /// selected. This value may be ignored by platforms that cannot support it. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally don't attempt to cover every possible use case of an API in the README; I don't think this section adds any substantive information beyond what the updated doc comments says, so doesn't justify the additional README length.