distinctBy method
Implementation
List<T> distinctBy(dynamic Function(T e) identity) {
final seen = <dynamic>{};
final result = <T>[];
for (final e in this) {
final id = identity(e);
if (!seen.contains(id)) {
seen.add(id);
result.add(e);
}
}
return result;
}