feat: Changes based on integration issues

This commit is contained in:
2023-06-18 20:44:05 +02:00
parent 499817313d
commit 8b91c07fb8
4 changed files with 66 additions and 65 deletions

View File

@@ -52,19 +52,6 @@ class ListDiff<T> {
final List<T> removed;
}
extension BeforeAfterListDiff<T> on List<T> {
/// Compute the set-based changes between this list and [newList].
ListDiff<T> diff(List<T> newList) {
final oldSet = Set<T>.from(this);
final newSet = Set<T>.from(newList);
return ListDiff(
newSet.difference(oldSet).toList(),
oldSet.difference(newSet).toList(),
);
}
}
extension AppendToListOrCreateExtension<K, V> on Map<K, List<V>> {
/// Create or append [value] to the list identified with key [key].
void appendOrCreate(K key, V value, {bool checkExistence = false}) {