replaceLocally method
Implementation
void replaceLocally(
bool Function(T oldItem) indexWhere,
T item,
) {
final data = [...(state.data ?? <T>[])];
final index = data.indexWhere(indexWhere);
if (index != -1) {
data[index] = item;
_emitUpdatedData(data);
}
}