Skip to content

Instantly share code, notes, and snippets.

@Alexi-Zemcov
Created October 27, 2024 16:26
Show Gist options
  • Save Alexi-Zemcov/ec1930739dc7e2830ba2bf1cacbba91f to your computer and use it in GitHub Desktop.
Save Alexi-Zemcov/ec1930739dc7e2830ba2bf1cacbba91f to your computer and use it in GitHub Desktop.
Remove duplicates from List
void main() {
final categoryName = [];
categoryName.addAll(['one', 'thwo', 'thwo', 'thwo', 'three', 'one']);
print('categoryName before removing duplicates:');
print(categoryName);
final unicCategory = categoryName.toSet().toList();
print('unicCategory without duplicates:');
print(unicCategory);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment