How can I make my list unique in dart language?

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

I want to get an output like below in the above list. How can I do it?

[0,0],[1,1]
1 Answers
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);    
    }
  }

I referred to Jahidul's comment.

Related