removeDuplicates method
Return a new list without duplicated elements
you can use .toSet().toList()
but the order may not be the same
Implementation
List<T> removeDuplicates([bool Function(T a, T b)? compare]) {
var tempList = <T>[];
forEach((a) {
if (!tempList.any((b) => compare == null ? a == b : compare(a, b))) {
tempList.add(a);
}
});
return tempList;
}