Skip to content

Commit

Permalink
Fixed remove item animation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham16g committed Jan 19, 2023
1 parent 829ccc1 commit 081d260
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.0.13
- Fixed remove item animation bug

## 0.0.12
- Github pages demo project added
- maxImages 1 support
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.12"
version: "0.0.13"
path:
dependency: transitive
description:
Expand Down
6 changes: 2 additions & 4 deletions lib/src/multi_image_picker_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ class MultiImagePickerController with ChangeNotifier {
}

/// Manually re-order image, i.e. move image from one position to another position.
void reOrderImage(int oldIndex, int newIndex, {bool notify = true}) {
void reOrderImage(int oldIndex, int newIndex) {
final oldItem = _images.removeAt(oldIndex);
oldItem.size;
_images.insert(newIndex, oldItem);
if (notify) {
notifyListeners();
}
notifyListeners();
}

/// Manually remove image from list.
Expand Down
3 changes: 1 addition & 2 deletions lib/src/multi_image_picker_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ class _MultiImagePickerViewState extends State<MultiImagePickerView> {
onReorder: (List<OrderUpdateEntity> orderUpdateEntities) {
for (final orderUpdateEntity in orderUpdateEntities) {
widget.controller.reOrderImage(
orderUpdateEntity.oldIndex, orderUpdateEntity.newIndex,
notify: false);
orderUpdateEntity.oldIndex, orderUpdateEntity.newIndex);
if (widget.onChange != null) {
widget.onChange!(widget.controller.images);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.12
version: 0.0.13
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
Expand Down

0 comments on commit 081d260

Please sign in to comment.