Skip to content

Commit

Permalink
[image_picker] Adds comment for the limit parameter (#6678)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinXunFeng committed May 31, 2024
1 parent decb460 commit d8e8e8c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/image_picker/image_picker/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ Aleksandr Yurkovskiy <sanekyy@gmail.com>
Anton Borries <mail@antonborri.es>
Alex Li <google@alexv525.com>
Rahul Raj <64.rahulraj@gmail.com>
LinXunFeng <linxunfeng@yeah.net>
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.2

* Adds comment for the limit parameter.

## 1.1.1

* Updates documentation to note that Android Photo Picker use is not optional on Android 13+.
Expand Down
6 changes: 6 additions & 0 deletions packages/image_picker/image_picker/lib/image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class ImagePicker {
/// image types such as JPEG and on Android PNG and WebP, too. If compression is not
/// supported for the image that is picked, a warning message will be logged.
///
/// The `limit` parameter modifies the maximum number of images that can be selected.
/// This value may be ignored by platforms that cannot support it.
///
/// Use `requestFullMetadata` (defaults to `true`) to control how much additional
/// information the plugin tries to get.
/// If `requestFullMetadata` is set to `true`, the plugin tries to get the full
Expand Down Expand Up @@ -225,6 +228,9 @@ class ImagePicker {
/// image types such as JPEG and on Android PNG and WebP, too. If compression is not
/// supported for the image that is picked, a warning message will be logged.
///
/// The `limit` parameter modifies the maximum number of media that can be selected.
/// This value may be ignored by platforms that cannot support it.
///
/// Use `requestFullMetadata` (defaults to `true`) to control how much additional
/// information the plugin tries to get.
/// If `requestFullMetadata` is set to `true`, the plugin tries to get the full
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.1.1
version: 1.1.2

environment:
sdk: ^3.3.0
Expand Down
1 change: 1 addition & 0 deletions packages/image_picker/image_picker_android/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ Anton Borries <mail@antonborri.es>
Alex Li <google@alexv525.com>
Rahul Raj <64.rahulraj@gmail.com>
André Sousa <andrelvsousa@gmail.com>
LinXunFeng <linxunfeng@yeah.net>
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.8.12+3

* Update documentation to note that limit is not always supported.

## 0.8.12+2

* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
Expand Down
3 changes: 3 additions & 0 deletions packages/image_picker/image_picker_android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ import 'package:image_picker_platform_interface/image_picker_platform_interface.
}
```

In addition, `ImagePickerAndroid.useAndroidPhotoPicker` must be set to `true` to use the `limit` functionality. It is implemented based on [`ActivityResultContract`][3], so it can only be ensured to take effect on Android 13 or above. Otherwise, it depends on whether the corresponding system app supports it.

[1]: https://pub.dev/packages/image_picker
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
[3]: https://developer.android.google.cn/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.PickMultipleVisualMedia
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker_android
description: Android implementation of the image_picker plugin.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.8.12+2
version: 0.8.12+3

environment:
sdk: ^3.4.0
Expand Down

0 comments on commit d8e8e8c

Please sign in to comment.