DEV Community

Discussion on: How to remove duplicates from an array in Dart

Collapse
 
whoami_ profile image
whoami

simpler
final list = [1, 2, 2, 3, 4, 4, 4].toSet().toList();

Collapse
 
jrmatanda profile image
Ben Matt, Jr.

Yes but for an example doing things step by step is better, for readability.