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

Code Example 1

var ids = [1, 4, 4, 4, 5, 6, 6];
  var distinctIds = ids.toSet().toList();

Learn ReactJs, React Native from akashmittal.com