convertMap method
Implementation
Map<String, dynamic> convertMap(Map<Object?, Object?> map) {
return map.map((key, value) {
// Handle nested maps
if (value is Map<Object?, Object?>) {
value = convertMap(value);
}
// Handle lists that might contain maps
else if (value is List) {
value = convertList(value);
}
return MapEntry(key.toString(), value);
});
}