Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneha-s committed Aug 6, 2024
1 parent 860ab26 commit 933bf6b
Showing 1 changed file with 0 additions and 5 deletions.
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

0 comments on commit 933bf6b

Please sign in to comment.