Created
August 5, 2022 21:18
-
-
Save rohan20/d582f972e8c7457dd21b0c81a0155f3e to your computer and use it in GitHub Desktop.
Pretty print JSON in Dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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