Skip to content

Commit

Permalink
Minor changes (#77)
Browse files Browse the repository at this point in the history
* Minor changes

* Minor changes
  • Loading branch information
cp-sneha-s authored Aug 6, 2024
1 parent 860ab26 commit ad84519
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#v1.0.9

- Minor changes

#v1.0.8

# Changelog
Expand Down
5 changes: 0 additions & 5 deletions lib/src/builder/motion_list_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,17 @@ abstract class MotionListBaseState<
}

void calculateDiff(List oldList, List newList) {
// if(widget.onrReorder != null && oldList.length == newList.length) {
// return;
// }
// Detect removed and updated items
for (int i = oldList.length - 1; i >= 0; i--) {
if (newList.indexWhere((element) => isSameItem(oldList[i], element)) ==
-1) {
print("item is deleted: $i");
listKey.currentState!.removeItem(i, removeItemDuration: removeDuration);
}
}
// Detect added items
for (int i = 0; i < newList.length; i++) {
if (oldList.indexWhere((element) => isSameItem(newList[i], element)) ==
-1) {
print("item is added: $i");
listKey.currentState!.insertItem(i, insertDuration: insertDuration);
}
}
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: animated_reorderable_list
description: A Flutter Reorderable Animated List with simple implementation and smooth transition.
version: 1.0.8
version: 1.0.9
repository: https://github.com/canopas/animated_reorderable_list

environment:
Expand Down

0 comments on commit ad84519

Please sign in to comment.