diff --git a/AUTHORS b/AUTHORS index d145538022d2..543b9813fe2a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -74,3 +74,4 @@ Twin Sun, LLC Amir Panahandeh Daniele Cambi Michele Benedetti +Taskulu LDA \ No newline at end of file diff --git a/packages/image_picker/image_picker_for_web/CHANGELOG.md b/packages/image_picker/image_picker_for_web/CHANGELOG.md index 6b01e90c0e0e..42111555330f 100644 --- a/packages/image_picker/image_picker_for_web/CHANGELOG.md +++ b/packages/image_picker/image_picker_for_web/CHANGELOG.md @@ -1,6 +1,7 @@ -## NEXT +## 3.0.2 * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. +* Removes input element after completion ## 3.0.1 diff --git a/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart b/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart index 5a3af7eab573..94adce2411e4 100644 --- a/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart +++ b/packages/image_picker/image_picker_for_web/example/integration_test/image_picker_for_web_test.dart @@ -50,6 +50,9 @@ void main() { source: ImageSource.camera, ); + expect(html.querySelector('flt-image-picker-inputs')?.children.isEmpty, + isFalse); + // Mock the browser behavior of selecting a file... mockInput.dispatchEvent(html.Event('change')); @@ -68,6 +71,8 @@ void main() { completion( DateTime.fromMillisecondsSinceEpoch(textFile.lastModified!), )); + expect(html.querySelector('flt-image-picker-inputs')?.children.isEmpty, + isTrue); }); testWidgets('getMultiImageWithOptions can select multiple files', ( diff --git a/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart b/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart index b54b68ac550a..315b7ddd4469 100644 --- a/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart +++ b/packages/image_picker/image_picker_for_web/lib/image_picker_for_web.dart @@ -158,7 +158,7 @@ class ImagePickerPlugin extends ImagePickerPlatform { ) as html.FileUploadInputElement; _injectAndActivate(input); - return _getSelectedXFiles(input); + return _getSelectedXFiles(input).whenComplete(input.remove); } // Deprecated methods follow... diff --git a/packages/image_picker/image_picker_for_web/pubspec.yaml b/packages/image_picker/image_picker_for_web/pubspec.yaml index 4a1c4ea861eb..65c8196de806 100644 --- a/packages/image_picker/image_picker_for_web/pubspec.yaml +++ b/packages/image_picker/image_picker_for_web/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker_for_web description: Web platform implementation of image_picker repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_for_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 3.0.1 +version: 3.0.2 environment: sdk: ">=3.0.0 <4.0.0"