mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 12:07:58 -06:00
Added new query options for tags, added pdf preview on documents scanner page
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user