mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-12 09:10:44 -06:00
Initial commit
This commit is contained in:
9
lib/extensions/dart_extensions.dart
Normal file
9
lib/extensions/dart_extensions.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
extension NullableMapKey<K, V> on Map<K, V> {
|
||||
V? tryPutIfAbsent(K key, V? Function() ifAbsent) {
|
||||
final value = ifAbsent();
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
return putIfAbsent(key, () => value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user