unique method
Returns a new iterable with all duplicate elements removed.
The equals
function is used to determine if two elements are equal.
If it is not provided, the iterable's elements must be hashable and
the ==
operator is used for equality checks.
The order of the elements in the returned iterable is the same as the order in which they appear in the original iterable.
Implementation
Iterable<T> unique([
bool Function(T a, T b)? equals,
]) {
return _unique<T>(this, equals);
}