deepCatchesValues<T> function
Catches deeply values that matches filter
.
Returns a List of the matched values
Implementation
List deepCatchesValues<T>(Object? o, ValueFilter filter, [List? result]) {
result ??= [];
if (o == null) return result;
if (filter(null, null, o)) {
result.add(o);
} else if (o is List) {
deepCatchesListValues(o, filter, result);
} else if (o is Map) {
deepCatchesMapValues(o, filter, result);
} else if (o is Set) {
deepCatchesSetValues(o, filter, result);
}
return result;
}