Remove Duplicate Elements from List

var ids = [1, 4, 4, 4, 5, 6, 6];

//toSet and then toList
var distinctIds = ids.toSet().toList();

//Spread operators
var distinctIds = [...{...ids}];