updateItemEx method

IList<T> updateItemEx(
  1. T oldItem,
  2. T call(
    1. T old
    )
)

Implementation

IList<T> updateItemEx(T oldItem, T Function(T old) call) {
  final int index = indexOf(oldItem);
  if (index >= 0) {
    final T newItem = call(this.get(index));
    return replace(index, newItem);
  }
  return this;
}