prettyJson function

String prettyJson(
  1. dynamic json, {
  2. int indent = 2,
})

Implementation

String prettyJson(dynamic json, {int indent = 2}) {
  var spaces = ' ' * indent;
  var encoder = JsonEncoder.withIndent(spaces);
  return encoder.convert(json);
}