Added new query options for tags, added pdf preview on documents scanner page

This commit is contained in:
Anton Stubenbord
2022-11-18 00:59:14 +01:00
parent e9019bca9c
commit 070a57aafd
32 changed files with 454 additions and 205 deletions

View File

@@ -7,3 +7,18 @@ extension NullableMapKey<K, V> on Map<K, V> {
return putIfAbsent(key, () => value);
}
}
extension Unique<E, Id> on List<E> {
List<E> unique([Id Function(E element)? id, bool inplace = true]) {
final ids = <Id>{};
var list = inplace ? this : List<E>.from(this);
list.retainWhere((x) => ids.add(id != null ? id(x) : x as Id));
return list;
}
}
extension DuplicateCheckable<T> on Iterable<T> {
bool hasDuplicates() {
return toSet().length != length;
}
}