listNub<T> function
Remove duplicate elements.
Implementation
List<T> listNub<T>(Iterable<T> original, [Iterable<T>? itemsToNub]) {
if (original.isEmpty) {
return [];
}
List<T> result = [];
for (var v in original) {
if (!deepContains(result, v)) {
result.add(v);
continue;
}
if (itemsToNub != null && !deepContains(itemsToNub, v)) {
result.add(v);
}
}
return result;
}