replaceFirstWhere method

void replaceFirstWhere(
  1. bool condition(
    1. T item
    ),
  2. T replace(
    1. T item
    )
)

Replaces the first items from current list, checked by condition and replaced by replace.

Implementation

void replaceFirstWhere(bool Function(T item) condition, T Function(T item) replace) {
  return replaceWhere(condition, replace, count: 1);
}