Question : dart compare two lists
Answered by : glamorous-gharial-a6f19c3x24eu
if (list1.any((item) => list2.contains(item))) { // Lists have at least one common element
} else { // Lists DON'T have any common element
}
Source : https://stackoverflow.com/questions/54401742/comparing-two-string-lists-and-check-if-they-have-at-least-one-same-string | Last Update : Tue, 28 Jul 20
Question : dart list equality
Answered by : john-james
Function eq = const ListEquality().equals;
print(eq([1,'two',3], [1,'two',3])); // => true
Source : https://stackoverflow.com/questions/10404516/how-can-i-compare-lists-for-equality-in-dart | Last Update : Mon, 25 May 20