filterList<T> function
Only keep elements that meet criteria
Implementation
List<T> filterList<T>(
bool Function(T sub) filterFunction, Iterable<T> original) {
if (original.isEmpty) {
return [];
}
List<T> copy = List.from(original);
for (T v in listNub(original)) {
if (!filterFunction(v)) {
copy.removeWhere((element) => element == v);
}
}
return copy;
}