Check out example codes for "dart list equality". It will help you in understanding the concepts better.

Code Example 1

if (list1.any((item) => list2.contains(item))) {
    // Lists have at least one common element
} else {
    // Lists DON'T have any common element
}

Code Example 2

Function eq = const ListEquality().equals;
print(eq([1,'two',3], [1,'two',3])); // => true

Learn ReactJs, React Native from akashmittal.com