deleteItem method

dynamic deleteItem({
  1. required T data,
  2. bool comparator(
    1. T t1,
    2. T t2
    )?,
})

Implementation

deleteItem({required T data, bool Function(T t1, T t2)? comparator}) {
  int tag = tagOfItem(data: data, comparator: comparator);
  if (tag < 1) return;
  animatedIndex.value = -tag;
  Future.delayed(duration!, () {
    animatedIndex.value = 0;
    items.value.removeAt(tag - 1);
    items.notifyListeners();
    print(items.value[0]);
  });
}