Skip to content

Instantly share code, notes, and snippets.

@rohan20
Created August 5, 2022 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohan20/d582f972e8c7457dd21b0c81a0155f3e to your computer and use it in GitHub Desktop.
Save rohan20/d582f972e8c7457dd21b0c81a0155f3e to your computer and use it in GitHub Desktop.
Pretty print JSON in Dart
import 'dart:convert' show JsonEncoder;
void prettyPrintJson(dynamic object) {
print(JsonEncoder.withIndent(" ").convert(object));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment