fares 9 сар өмнө
parent
commit
d52b6980dd

+ 12 - 9
lib/handlers/file_upload_api.dart

@@ -567,6 +567,7 @@ class FileProcess {
                   : [],
             };
             logs.add(row);
+            print("   Tracker:$tracker row: $row ");
           }
         }
 
@@ -661,15 +662,17 @@ extension CompareIterables<T> on Iterable<T> {
   }
 }
 
-extension FilterMapByKeys on Map {
-  /// Returns a new map containing only the keys (and their associated values)
-  /// that are present in the [keysToKeep] list.
-  Map<K, V> filterKeys<K, V>(List<K> keysToKeep) {
-    return Map<K, V>.fromEntries(
-      entries
-          .where((entry) => keysToKeep.contains(entry.key))
-          .cast<MapEntry<K, V>>(),
-    );
+extension FilterMapByKeys<K, V> on Map<K, V> {
+  Map<K, V?> filterKeys(List<K> keysToKeep) {
+    final filteredMap = <K, V?>{};
+
+    for (final key in keysToKeep) {
+      if (this.containsKey(key)) {
+        filteredMap[key] = this[key];
+      }
+    }
+
+    return filteredMap;
   }
 }