diff --git a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md index bcba89bd3974..fc3d604c88ef 100644 --- a/packages/image_picker/image_picker_platform_interface/CHANGELOG.md +++ b/packages/image_picker/image_picker_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.9.0 + +* Formally deprecates all methods that have been replaced with newer variants. + ## 2.8.0 * Adds `getMedia` method. diff --git a/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart b/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart index 66c5d3b57854..a31fbbab322a 100644 --- a/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart +++ b/packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart @@ -37,8 +37,6 @@ abstract class ImagePickerPlatform extends PlatformInterface { _instance = instance; } - // Next version of the API. - /// Returns a [PickedFile] with the image that was picked. /// /// The `source` argument controls where the image comes from. This can @@ -67,6 +65,7 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// in this call. You can then call [retrieveLostData] when your app relaunches to retrieve the lost data. /// /// If no images were picked, the return value is null. + @Deprecated('Use getImageFromSource instead.') Future pickImage({ required ImageSource source, double? maxWidth, @@ -95,6 +94,7 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// a warning message will be logged. /// /// If no images were picked, the return value is null. + @Deprecated('Use getMultiImageWithOptions instead.') Future?> pickMultiImage({ double? maxWidth, double? maxHeight, @@ -119,6 +119,7 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// in this call. You can then call [retrieveLostData] when your app relaunches to retrieve the lost data. /// /// If no images were picked, the return value is null. + @Deprecated('Use getVideo instead.') Future pickVideo({ required ImageSource source, CameraDevice preferredCameraDevice = CameraDevice.rear, @@ -141,12 +142,11 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// See also: /// * [LostData], for what's included in the response. /// * [Android Activity Lifecycle](https://developer.android.com/reference/android/app/Activity.html), for more information on MainActivity destruction. + @Deprecated('Use getLostData instead.') Future retrieveLostData() { throw UnimplementedError('retrieveLostData() has not been implemented.'); } - /// This method is deprecated in favor of [getImageFromSource] and will be removed in a future update. - /// /// Returns an [XFile] with the image that was picked. /// /// The `source` argument controls where the image comes from. This can @@ -175,6 +175,7 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data. /// /// If no images were picked, the return value is null. + @Deprecated('Use getImageFromSource instead.') Future getImage({ required ImageSource source, double? maxWidth, @@ -185,8 +186,6 @@ abstract class ImagePickerPlatform extends PlatformInterface { throw UnimplementedError('getImage() has not been implemented.'); } - /// This method is deprecated in favor of [getMultiImageWithOptions] and will be removed in a future update. - /// /// Returns a [List] with the images that were picked. /// /// The images come from the [ImageSource.gallery]. @@ -205,6 +204,7 @@ abstract class ImagePickerPlatform extends PlatformInterface { /// a warning message will be logged. /// /// If no images were picked, the return value is null. + @Deprecated('Use getMultiImageWithOptions instead.') Future?> getMultiImage({ double? maxWidth, double? maxHeight, diff --git a/packages/image_picker/image_picker_platform_interface/pubspec.yaml b/packages/image_picker/image_picker_platform_interface/pubspec.yaml index 67a5070f6c78..3c51cb1f705d 100644 --- a/packages/image_picker/image_picker_platform_interface/pubspec.yaml +++ b/packages/image_picker/image_picker_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/image_picker/ 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.8.0 +version: 2.9.0 environment: sdk: ">=2.18.0 <4.0.0"