printJson function

void printJson(
  1. dynamic json, {
  2. String? title,
})

Implementation

void printJson(dynamic json, {String? title}) {
  JsonEncoder encoder = const JsonEncoder.withIndent('  ');

  // encode it to string
  String prettyPrint = encoder.convert(json);

  if (title != null) {
    debugPrint(title);
  }
  printWrapped(prettyPrint);
}