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..7f4797b 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