[DEV] Done with the Chip selector
This commit is contained in:
20
lib/Infrastructure/list_extensions.dart
Normal file
20
lib/Infrastructure/list_extensions.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
extension ListExtension<E> on List<E> {
|
||||
bool containsAll(List<E> otherList) {
|
||||
List<bool> checks = [];
|
||||
//
|
||||
for (E thisElement in otherList) {
|
||||
checks.add(contains(thisElement));
|
||||
}
|
||||
return !checks.contains(false);
|
||||
}
|
||||
|
||||
List<E> getUnique() {
|
||||
List<E> uniqueItems = [];
|
||||
for (E thisElement in this) {
|
||||
if (!uniqueItems.contains(thisElement)) {
|
||||
uniqueItems.add(thisElement);
|
||||
}
|
||||
}
|
||||
return uniqueItems;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user