deepCatchesSetValues<T> function
Catches deeply set
values that matches filter
.
Returns a List of the matched values
Implementation
List deepCatchesSetValues<T>(Set? set, ValueFilter filter, [List? result]) {
result ??= [];
if (set == null || set.isEmpty) return result;
for (var val in set) {
if (filter(set, null, val)) {
result.add(val);
} else {
deepCatchesValues(val, filter, result);
}
}
return result;
}