如何用飞镖语言使我的列表独一无二


List<List<int>> intArr = [
[0, 0],
[1, 1],
[1, 1],
];

我想在上面的列表中获得如下输出。我该怎么做?

[0,0],[1,1]
import 'package:collection/collection.dart'; // Must be imported
/// Below codes must be inside a function
List<List<int>> intArr = [[0, 0],[1, 1],[1, 1]];
List<List<int>> newList = [];
Function eq = const ListEquality().equals;

for (var i in intArr) {
if (!newList.any((v) => eq(v, i))) {
newList.add(i);    
}
}

我提到了贾希杜尔的评论。

最新更新