flattenStrings method
Implementation
Map<String, String> flattenStrings(
Map<String, dynamic> map, [
String prefix = '',
]) {
final out = <String, String>{};
map.forEach((key, value) {
final path = prefix.isEmpty ? key : '$prefix.$key';
if (value is String) {
out[path] = value;
} else if (value is Map) {
out.addAll(flattenStrings(Map<String, dynamic>.from(value), path));
}
});
return out;
}