expandJson method
Flattens input with flattenJson, then adds a shortened alias key for
every path suffix, as expandFlattenedJson does:
{'a': {'b': 1}} becomes {'a.b': 1, 'b': 1}.
This does not rebuild nested maps; for that, see unflattenJson.
Implementation
Map<String, dynamic> expandJson(
Map<String, dynamic> input, {
String separator = '.',
}) {
return expandFlattenedJson(
flattenJson(input, separator: separator),
separator: separator,
);
}