jsonPrettify method

String? jsonPrettify({
  1. String indent = ' ',
})

Prettifies this JSON string with proper indentation

indent The indentation string (defaults to 2 spaces)

Returns the prettified JSON string or null if parsing fails

Example:

final minified = '{"name":"John","age":30}';
print(minified.jsonPrettify());
// {
//   "name": "John",
//   "age": 30
// }

Implementation

String? jsonPrettify({String indent = '  '}) {
  return QJSONUtils.prettify(this, indent: indent);
}