[image_picker] Image picker phpicker impl (#3835)

* Add PHPicker libraries and its delegate

I have to implement PHPicker to select photos, live photos and videos from the photo library for iOS 14 and higher versions. But I also have to keep old UIImagePickerController for lower iOS versions and to use camera.

* Add PHPicker implementation

* Refactor UIImagePickerController implementation

I moved the UIImagePickerController implementation into pickImageWithUIImagePicker method for code reusability.

* Refactor handleMethodCall function

* Refactor showPhotoLibrary function

* Add the limited access into the photo library

I refactored the checkPhotoAuthorization function to add limited access functionality. Also I implemented showLimitedPhotoLibrary function to call presentLimitedLibraryPickerFromViewController.

* Add the implementation of picker function

I implemented picker function that is came from PHPickerViewControllerDelegate.

* Refactor Info.plist file

I added PHPhotoLibraryPreventAutomaticLimitedAccessAlert = YES into Info.plist to use limited access functionality.

* Add the function to get PHAssetResult

* Change the image to bypass HEIC problem

* Add UITest to test select photo functionality

* Add unit test for PHAssetResult

* Format the codes in all files

* Fix the unit test

* Update the version

* Add the description into CHANGELOG file

* Fix the license header

* Remove the unnecessary if statement

* Refactor PHPickerViewController to use property

* Refactor phPickerFlag state to use property

* Refactor the code to combine lines

* Refactor arguments to use property

* Revert formatting changes

This reverts part of commit 36b6a2aec20be6c76748f27a07d9f670d33a1313.

* Fix the unit test

* Format the code

* Refactor the UITest to skip lower versions

* Fix the property's name

* Refactor the properties to pass them via methods

* Add the getDesiredImageQuality method

* Add API_AVAILABLE for limited access method

* Refactor PHPickerController to use as a property

* Refactor PHPicker picker method and UITest

* Refactor the UITest

Move to UITest to new target file to test on iOS 14 and higher versions.

* Change the team to None  in the RunnerUITestiOS14

* Fix the UITest

* Refactor the method to fix dispatch

* Change to use self instead of weakSelf

* Fix the UITest to use XCTSkip

* Add ImagePickerClassType to use enum

* Remove unused method

If the user enabled limited library access, use presentLimitedLibraryPickerFromViewController to present the limited library picker so they may update their selection. But in this case, limited access status will not return with old requestAuthorization implementation in checkPhotoAuthorization method. So this method will not be used.

* Fix property to change copy to strong

* Refactor enum

* Change argument call

* Add checkPhotoAuthorizationForAccessLevel method

I implemented requestAuthorizationForAccessLevel which is the new way to handle the photo library authorization with iOS 14+.
12 files changed
tree: 433f6ba231d101866eda69a63d790444f1ae59a9
  1. .ci/
  2. .github/
  3. .opensource/
  4. packages/
  5. script/
  6. .cirrus.yml
  7. .clang-format
  8. .gitattributes
  9. .gitignore
  10. analysis_options.yaml
  11. analysis_options_legacy.yaml
  12. AUTHORS
  13. CODEOWNERS
  14. CONTRIBUTING.md
  15. FlutterFire.md
  16. LICENSE
  17. README.md
README.md

Flutter plugins

Build Status

This repo is a companion repo to the main flutter repo. It contains the source code for Flutter first-party plugins (i.e., plugins developed by the core Flutter team). Check the packages directory for all plugins.

Flutter plugins enable access to platform-specific APIs. For more information about plugins, and how to use them, see https://flutter.dev/platform-plugins/.

These plugins are also available on pub.

Issues

Please file any issues, bugs, or feature requests in the main flutter repo.

Issues pertaining to this repository are labeled “plugin”.

Contributing

If you wish to contribute a new plugin to the Flutter ecosystem, please see the documentation for developing packages and platform channels. You can store your plugin source code in any GitHub repository (the present repo is only intended for plugins developed by the core Flutter team). Once your plugin is ready you can publish to the pub repository.

If you wish to contribute a change to any of the existing plugins in this repo, please review our contribution guide, and send a pull request.

Plugins

These are the available plugins in this repository.

PluginPubPointsPopularityLikes
android_alarm_managerpub packagepub pointspopularitylikes
android_intentpub packagepub pointspopularitylikes
batterypub packagepub pointspopularitylikes
camerapub packagepub pointspopularitylikes
connectivitypub packagepub pointspopularitylikes
device_infopub packagepub pointspopularitylikes
espressopub packagepub pointspopularitylikes
flutter_plugin_android_lifecyclepub packagepub pointspopularitylikes
google_maps_flutterpub packagepub pointspopularitylikes
google_sign_inpub packagepub pointspopularitylikes
image_pickerpub packagepub pointspopularitylikes
integration_test (discontinued)pub packagepub pointspopularitylikes
in_app_purchasepub packagepub pointspopularitylikes
ios_platform_imagespub packagepub pointspopularitylikes
local_authpub packagepub pointspopularitylikes
package_infopub packagepub pointspopularitylikes
path_providerpub packagepub pointspopularitylikes
plugin_platform_interfacepub packagepub pointspopularitylikes
quick_actionspub packagepub pointspopularitylikes
sensorspub packagepub pointspopularitylikes
sharepub packagepub pointspopularitylikes
shared_preferencespub packagepub pointspopularitylikes
url_launcherpub packagepub pointspopularitylikes
video_playerpub packagepub pointspopularitylikes
webview_flutterpub packagepub pointspopularitylikes