convertMapToMap method

Map<String, dynamic> convertMapToMap(
  1. Map<Object?, Object?> map
)

Implementation

Map<String, dynamic> convertMapToMap(Map<Object?, Object?> map) {
  // Create an empty Map<String, dynamic>
  Map<String, dynamic> resultMap = {};
  // Iterate through the entries of the Map
  for (var entry in map.entries) {
    // Check if the key is a String and value is dynamic
    if (entry.key is String && entry.value is dynamic) {
      // Add the entry to the resultMap with appropriate types
      resultMap[entry.key as String] = entry.value;
    } else {}
  }
  // Return the resulting Map<String, dynamic>
  return resultMap;
}