Skip to content

Commit 7660d46

Browse files
authored
[image_picker] Document that retrieving lost data is a one-time operation (flutter#12784)
Documents that lost-data retrieval is destructive: once the lost data is returned it is cleared, so subsequent calls return an empty result. Adds the note at both the app-facing layer (`ImagePicker.retrieveLostData`) and the platform interface (`ImagePickerPlatform.getLostData`), matching the intended behavior described in the issue. This is a documentation-only change (dartdoc plus CHANGELOG), so adds no tests (test-exempt). Fixes flutter#164223 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent b6798fa commit 7660d46

6 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎packages/image_picker/image_picker/CHANGELOG.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## NEXT
1+
## 1.2.4
22

3+
* Documents that `retrieveLostData` is a one-time operation that clears the
4+
stored lost data once it is returned.
35
* Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
46

57
## 1.2.3

‎packages/image_picker/image_picker/lib/image_picker.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ class ImagePicker {
353353
/// Returns a [LostDataResponse] object if successfully retrieved the lost data. The [LostDataResponse] object can \
354354
/// represent either a successful image/video selection, or a failure.
355355
///
356+
/// Retrieving the lost data is a one-time operation: once it is returned, the
357+
/// data is cleared, so subsequent calls return an empty [LostDataResponse]
358+
/// rather than the same data again.
359+
///
356360
/// Calling this on a non-Android platform will throw [UnimplementedError] exception.
357361
///
358362
/// See also:

‎packages/image_picker/image_picker/pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image
33
library, and taking new pictures with the camera.
44
repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
6-
version: 1.2.3
6+
version: 1.2.4
77

88
environment:
99
sdk: ^3.11.0

‎packages/image_picker/image_picker_platform_interface/CHANGELOG.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## NEXT
1+
## 2.11.2
22

3+
* Documents that `getLostData` must clear the stored lost data once it is
4+
returned, so subsequent calls return an empty result.
35
* Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
46

57
## 2.11.1

‎packages/image_picker/image_picker_platform_interface/lib/src/platform_interface/image_picker_platform.dart‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ abstract class ImagePickerPlatform extends PlatformInterface {
257257
/// Returns a [LostDataResponse] object if successfully retrieved the lost data. The [LostDataResponse] object can
258258
/// represent either a successful image/video selection, or a failure.
259259
///
260+
/// Retrieving the lost data is a one-time operation: implementations must
261+
/// clear the stored data once it has been returned, so that subsequent calls
262+
/// return an empty [LostDataResponse] rather than the same data again.
263+
///
260264
/// Calling this on a non-Android platform will throw [UnimplementedError] exception.
261265
///
262266
/// See also:

‎packages/image_picker/image_picker_platform_interface/pubspec.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/image_picker/
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.11.1
7+
version: 2.11.2
88

99
environment:
1010
sdk: ^3.11.0

0 commit comments

Comments
 (0)