withoutRedundancies<T> function
Implementation
List<T> withoutRedundancies<T>(List<T> list) {
var reversedResult = <T>[];
var used = <T>{}; // "used" is Set<T>()
for (var x in list.reversed) {
if (!used.contains(x)) {
reversedResult.add(x);
used.add(x);
}
}
return reversedResult.reversed.toList();
}