deepCatchesMapValues<T> function
Catches deeply map
values that matches filter
.
Returns a List of the matched values
Implementation
List deepCatchesMapValues<T>(Map? map, ValueFilter filter, [List? result]) {
result ??= [];
if (map == null || map.isEmpty) return result;
for (var entry in map.entries) {
var k = entry.key;
var v = entry.value;
if (filter(map, k, v)) {
result.add(v);
} else {
deepCatchesValues(v, filter, result);
}
}
return result;
}