tagOfItem method
Implementation
tagOfItem({required T data, bool Function(T t1, T t2)? comparator}) {
int tag = -1;
if (comparator == null) {
if (items.value.any((element) => element == data)) {
tag = items.value.indexOf(data);
tag += 1;
}
} else {
if (items.value.any((element) => comparator(element, data))) {
tag = items.value.indexWhere((element) => comparator(element, data));
tag += 1;
}
}
return tag;
}