This commit is contained in:
2025-03-03 16:15:12 +02:00
parent 24cd167754
commit b780647445
3 changed files with 20 additions and 16 deletions

View File

@@ -62,7 +62,7 @@
"languageVersion": "3.6" "languageVersion": "3.6"
} }
], ],
"generated": "2025-03-03T14:08:32.247456Z", "generated": "2025-03-03T14:15:05.778488Z",
"generator": "pub", "generator": "pub",
"generatorVersion": "3.7.0", "generatorVersion": "3.7.0",
"flutterRoot": "file:///C:/Users/micwa/fvm/versions/stable", "flutterRoot": "file:///C:/Users/micwa/fvm/versions/stable",

View File

@@ -13,7 +13,7 @@ Developed, Maintained, and is property of Michael W. Aziz (Micazi)
- on _List<E>_ - on _List<E>_
- **containsAll()** : Checker to see if a list contains all of the other list. ☑️ - **containsAll()** : Checker to see if a list contains all of the other list. ☑️
- **getUnique()** : Get unique items only of a supplied list. ☑️ - **getUnique()** : Get unique items only of a supplied list. ☑️
- on _Map<T,B>_ - on _List<Map<T,B>>_
- **mergeAllMaps()** : Merges a list of maps into one with a conditional functionality to approve the merge. ☑️ - **mergeAllMaps()** : Merges a list of maps into one with a conditional functionality to approve the merge. ☑️
- on _TextAlignVertical_ - on _TextAlignVertical_
- **toAlignment()** : convert a `TextAlignVertical` to an `Alignment` object. ☑️ - **toAlignment()** : convert a `TextAlignVertical` to an `Alignment` object. ☑️

View File

@@ -1,10 +1,13 @@
Map<T, B> mergeAllMaps<T, B>(List<Map<T, B>> maps, {Function(T key, B value1, B value2)? repeatingKeysValueComparer}) { extension MapExtensions<B, T> on Map<B, T> {}
Map<T, B> r = <T,B>{};
extension MapListExtensions<T, B> on List<Map<T, B>> {
Map<T, B> mergeAllMaps({Function(T key, B value1, B value2)? repeatingKeysValueComparer}) {
Map<T, B> r = <T, B>{};
// //
for (Map<T, B> m in maps) { for (Map<T, B> m in this) {
m.forEach((T key,B value) { m.forEach((T key, B value) {
if (!r.containsKey(key)) { if (!r.containsKey(key)) {
r.addEntries(<MapEntry<T, B>>[MapEntry<T,B>(key, value)]); r.addEntries(<MapEntry<T, B>>[MapEntry<T, B>(key, value)]);
} else { } else {
repeatingKeysValueComparer?.call(key, r[key] as B, value); repeatingKeysValueComparer?.call(key, r[key] as B, value);
} }
@@ -12,4 +15,5 @@ Map<T, B> mergeAllMaps<T, B>(List<Map<T, B>> maps, {Function(T key, B value1, B
} }
// //
return r; return r;
}
} }