deepReplaceListValues<T> function
Replaces values applying replacer
to values that matches filter
.
Implementation
void deepReplaceListValues<T>(
List? list, ValueFilter filter, ValueReplacer replacer) {
if (list == null || list.isEmpty) return;
for (var i = 0; i < list.length; ++i) {
var v = list[i];
if (filter(list, i, v)) {
list[i] = replacer(list, i, v);
} else {
list[i] = deepReplaceValues(v, filter, replacer);
}
}
}