printFormattedJson function
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);
}