image_picker_platform_interface
2.11.2A common platform interface for the image_picker plugin.
Readme
image_picker_platform_interface
A common platform interface for the image_picker plugin.
This interface allows platform-specific implementations of the image_picker
plugin, as well as the plugin itself, to ensure they are supporting the
same interface.
Usage
To implement a new platform-specific implementation of image_picker, extend
ImagePickerPlatform with an implementation that performs the
platform-specific behavior, and when you register your plugin, set the default
ImagePickerPlatform by calling
ImagePickerPlatform.instance = MyImagePickerPlatform().
Note on breaking changes
Strongly prefer non-breaking changes (such as adding a method to the interface) over breaking changes for this package.
See https://flutter.dev/go/platform-interface-breaking-changes for a discussion on why a less-clean interface is preferable to a breaking change.
Changelog
2.11.2
- Documents that
getLostDatamust clear the stored lost data once it is returned, so subsequent calls return an empty result. - Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
2.11.1
- Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
- Fixes typo in limit parameter validation error messages.
2.11.0
- Adds
getMultiVideoWithOptionsmethod. - Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
2.10.1
- Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
- Fixes Wasm tests in internal PickedFile implementation.
2.10.0
- Adds limit parameter to
MediaOptionsandMultiImagePickerOptions.
2.9.4
- Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
- Removes a few deprecated API usages.
2.9.3
- Updates minimum required plugin_platform_interface version to 2.1.7.
2.9.2
- Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
- Fixes new lint warnings.
2.9.1
- Adds pub topics to package metadata.
- Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.
2.9.0
- Formally deprecates all methods that have been replaced with newer variants.
2.8.0
- Adds
getMediamethod.
2.7.0
- Adds
CameraDelegatingImagePickerPlatformas a base class for platform implementations that don't supportImageSource.camera, but allow for an- implementation to be provided at the application level via implementation ofCameraDelegatingImagePickerPlatform. - Adds
supportsImageSourceto check source support at runtime.
2.6.4
- Adds compatibility with
http1.0. - Updates minimum supported SDK version to Flutter 3.3/Dart 2.18.
- Aligns Dart and Flutter SDK constraints.
2.6.3
- Updates links for the merge of flutter/plugins into flutter/packages.
- Updates minimum Flutter version to 3.0.
2.6.2
- Updates imports for
prefer_relative_imports. - Updates minimum Flutter version to 2.10.
- Fixes avoid_redundant_argument_values lint warnings and minor typos.
2.6.1
- Exports new types added for
getMultiImageWithOptionsin 2.6.0.
2.6.0
- Deprecates
getMultiImagein favor of a new methodgetMultiImageWithOptions.- Adds
requestFullMetadataoption that allows disabling extra permission requests on certain platforms. - Moves optional image picking parameters to
MultiImagePickerOptionsclass.
- Adds
2.5.0
- Deprecates
getImagein favor of a new methodgetImageFromSource.- Adds
requestFullMetadataoption that allows disabling extra permission requests on certain platforms. - Moves optional image picking parameters to
ImagePickerOptionsclass.
- Adds
- Minor fixes for new analysis options.
2.4.4
- Internal code cleanup for stricter analysis options.
2.4.3
- Removes dependency on
meta.
2.4.2
- Update to use the
verifymethod introduced in plugin_platform_interface 2.1.0.
2.4.1
- Reverts the changes from 2.4.0, which was a breaking change that was incorrectly marked as a non-breaking change.
2.4.0
- Add
forceFullMetadataoption topickImage.- To keep this non-breaking
forceFullMetadatadefaults totrue, so the plugin tries to get the full image metadata which may require extra permission requests on certain platforms. - If
forceFullMetadatais set tofalse, the plugin fetches the image in a way that reduces permission requests from the platform (e.g on iOS the plugin won’t ask for theNSPhotoLibraryUsageDescriptionpermission).
- To keep this non-breaking
2.3.0
- Updated
LostDataResponseto include afilesproperty, in case more than one file was recovered.
2.2.0
- Added new methods that return
XFile(frompackage:cross_file)getImage(will deprecatepickImage)getVideo(will deprecatepickVideo)getMultiImage(will deprecatepickMultiImage)
PickedFile will also be marked as deprecated in an upcoming release.
2.1.0
- Add
pickMultiImagemethod.
2.0.1
- Update platform_plugin_interface version requirement.
2.0.0
- Migrate to null safety.
- Breaking Changes:
- Removed the deprecated methods:
ImagePickerPlatform.retrieveLostDataAsDartIoFile,ImagePickerPlatform.pickImagePathandImagePickerPlatform.pickVideoPath. - Removed deprecated class:
LostDataResponse.
- Removed the deprecated methods:
1.1.6
- Fix test asset file location.
1.1.5
- Update Flutter SDK constraint.
1.1.4
- Pass
Uris topackage:httpmethods, instead of strings, in preparation for a major version update inhttp.
1.1.3
- Update documentation of
pickImage()regarding HEIC images.
1.1.2
- Update documentation of
pickImage()regarding compression support for specific image types.
1.1.1
- Update documentation of getImage() about Android's disability to preference front/rear camera.
1.1.0
- Introduce PickedFile type for the new API.
1.0.1
- Update lower bound of dart dependency to 2.1.0.
1.0.0
- Initial release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add image_picker_platform_interfacepubspec.yaml
name: image_picker_platform_interface
description: A common platform interface for the image_picker plugin.
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_platform_interface
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.11.2
environment:
sdk: ^3.11.0
flutter: ">=3.41.0"
dependencies:
cross_file: ^0.3.1+1
flutter:
sdk: flutter
http: ">=0.13.0 <2.0.0"
plugin_platform_interface: ^2.1.7
dev_dependencies:
flutter_test:
sdk: flutter
web: ^1.1.0
topics:
- image-picker
- files
- file-selection
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 1.0.0 | On demand | Download | a29bda9f…2425e4 |
| 1.1.0 | On demand | Download | e688b95e…337dff |
| 1.1.1 | On demand | Download | 5f3354cc…7ec72a |
| 1.1.6 | On demand | Download | 4e54be07…09e0f8 |
| 2.0.0-nullsafety | On demand | Download | 5f29115e…2cae35 |
| 2.0.0 | On demand | Download | df53f8e3…d1c169 |
| 2.0.1 | On demand | Download | f2005505…873ac1 |
| 2.1.0 | On demand | Download | a215b240…6e8df1 |
| 2.2.0 | On demand | Download | 74a9a1b3…822c82 |
| 2.3.0 | On demand | Download | 81956f2a…85c256 |
| 2.4.0 | On demand | Download | 6b35180f…627366 |
| 2.4.1 | On demand | Download | 7f88edc4…14bbd8 |
| 2.4.2 | On demand | Download | 6fd00a50…445259 |
| 2.4.3 | On demand | Download | dd0d3344…29ee54 |
| 2.4.4 | On demand | Download | 32eeb07c…a9eaf6 |
| 2.5.0 | On demand | Download | b5cfa6b0…cf4742 |
| 2.6.0 | On demand | Download | f714c258…badb93 |
| 2.6.1 | On demand | Download | cedb2650…2bf6ad |
| 2.6.2 | On demand | Download | 7cef2f28…f656b8 |
| 2.6.3 | On demand | Download | 1991219d…d3d4f8 |
| 2.6.4 | On demand | Download | 57e66df4…b48597 |
| 2.7.0 | On demand | Download | fa04ce09…7029a1 |
| 2.8.0 | On demand | Download | 7c7b96bb…9b65ee |
| 2.9.0 | On demand | Download | c1134543…bb2a32 |
| 2.9.1 | On demand | Download | ed9b00e6…b1b514 |
| 2.9.2 | On demand | Download | 0e827c15…ba239e |
| 2.9.3 | On demand | Download | fa4e815e…56233b |
| 2.9.4 | On demand | Download | 3d2c323d…96da38 |
| 2.10.0 | On demand | Download | 9ec26d41…802f80 |
| 2.10.1 | On demand | Download | 886d57f0…1236a0 |
| 2.11.0 | On demand | Download | 9f143b0d…f41665 |
| 2.11.1 | On demand | Download | 567e0567…15690c |
| 2.11.2 | Cached · Upstream SHA-256 matched | Download | 2dee4b4e…adc042 |
Dependencies
cross_file "^0.3.1+1"
flutter {
"sdk": "flutter"
}
http "\u003e=0.13.0 \u003c2.0.0"
plugin_platform_interface "^2.1.7"