From 42edd2092495280997c0cde7e31165f9f69c6833 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Wed, 18 Jan 2023 00:55:11 +0530 Subject: [PATCH 1/2] remove all images (clear selection) --- CHANGELOG.md | 3 +++ README.md | 1 + example/pubspec.lock | 2 +- lib/src/multi_image_picker_controller.dart | 6 ++++++ pubspec.yaml | 2 +- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21f4b25..c6a815c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.0.10 +- Remove all images (clear selection) + ## 0.0.9 - addButtonTitle optional field added - addMoreButtonTitle optional field added diff --git a/README.md b/README.md index 3c580fb..810f1ca 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,7 @@ controller.hasNoImages; // return bool controller.maxImages; // return maxImages controller.allowedImageTypes; // return allowedImageTypes controller.removeImage(imageFile); // remove image from the images +controller.clearImages(); // remove all images (clear selection) controller.reOrderImage(oldIndex, newIndex); // reorder the image ``` diff --git a/example/pubspec.lock b/example/pubspec.lock index d96f2ce..250eb98 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -148,7 +148,7 @@ packages: path: ".." relative: true source: path - version: "0.0.9" + version: "0.0.10" path: dependency: transitive description: diff --git a/lib/src/multi_image_picker_controller.dart b/lib/src/multi_image_picker_controller.dart index 3e44b00..ddfcc8a 100644 --- a/lib/src/multi_image_picker_controller.dart +++ b/lib/src/multi_image_picker_controller.dart @@ -75,4 +75,10 @@ class MultiImagePickerController with ChangeNotifier { _images.remove(imageFile); notifyListeners(); } + + /// Remove all selected images and show default UI + void clearImages(){ + _images.clear(); + notifyListeners(); + } } diff --git a/pubspec.yaml b/pubspec.yaml index acc37e9..dec58e4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: multi_image_picker_view description: A complete widget which can easily pick multiple images from device and display them in UI. Also picked image can be re-ordered and removed easily. -version: 0.0.9 +version: 0.0.10 homepage: https://github.com/shubham-gupta-16/multi_image_picker_view repository: https://github.com/shubham-gupta-16/multi_image_picker_view issue_tracker: https://github.com/shubham-gupta-16/multi_image_picker_view/issues From 215db08832ad2761c90c9e1fb1193196c1af07ab Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Wed, 18 Jan 2023 00:55:53 +0530 Subject: [PATCH 2/2] format fixed for 0.0.10 --- lib/src/multi_image_picker_controller.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/multi_image_picker_controller.dart b/lib/src/multi_image_picker_controller.dart index ddfcc8a..7f4797b 100644 --- a/lib/src/multi_image_picker_controller.dart +++ b/lib/src/multi_image_picker_controller.dart @@ -77,7 +77,7 @@ class MultiImagePickerController with ChangeNotifier { } /// Remove all selected images and show default UI - void clearImages(){ + void clearImages() { _images.clear(); notifyListeners(); }