updateWhere method

List<T> updateWhere(
  1. bool predicate(
    1. T check
    ),
  2. dynamic mutate(
    1. T input
    )
)

Implementation

List<T> updateWhere(bool predicate(T check), dynamic mutate(T input)) {
  return this.notNull().mapIndexed((T item, idx) {
        if (!predicate(item)) {
          return item;
        } else {
          final res = mutate(item);
          return res is T ? res : item;
        }
      });
}