expandJson method

Map<String, dynamic> expandJson(
  1. Map<String, dynamic> input, {
  2. String separator = '.',
})

Expands a Json map, e.g. {'a': {'b': 1}} to {a.b: 1, b: 1}.

Implementation

Map<String, dynamic> expandJson(
  Map<String, dynamic> input, {
  String separator = '.',
}) {
  return expandFlattenedJson(
    flattenJson(
      input,
      separator: separator,
    ),
    separator: separator,
  );
}