filter function
Removes undesired fields from a Map
.
Implementation
Map<String, dynamic> filter(Map inputData, Iterable<String> only) {
return inputData.keys.fold(<String, dynamic>{}, (map, key) {
if (only.contains(key.toString())) map[key.toString()] = inputData[key];
return map;
});
}