deepCatchesListValues<T> function
Catches deeply list
values that matches filter
.
Returns a List of the matched values
Implementation
List deepCatchesListValues<T>(List? list, ValueFilter filter, [List? result]) {
result ??= [];
if (list == null || list.isEmpty) return result;
for (var i = 0; i < list.length; ++i) {
var v = list[i];
if (filter(list, i, v)) {
result.add(v);
} else {
deepCatchesValues(v, filter, result);
}
}
return result;
}