printFormattedJson function

void printFormattedJson(
  1. Object json
)

Prints a JSON String in a nicely formatted manner.

Implementation

void printFormattedJson(Object json) {
  JsonEncoder encoder = const JsonEncoder.withIndent('  ');
  String formattedJson = encoder.convert(json);
  debugPrint(formattedJson);
}