Created
November 22, 2022 23:02
-
-
Save dhruvilp/6ec264306cebee9ac224cc07b04c17e3 to your computer and use it in GitHub Desktop.
Dart JSON Pretty print
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'; | |
void main(List<String> arguments) async { | |
final jsonResponse = jsonDecode( | |
"JSON"); | |
// final data = jsonResponse["sid_01"]; | |
JsonEncoder encoder = JsonEncoder.withIndent(' '); | |
String prettyprint = encoder.convert(jsonResponse); | |
print(prettyprint); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment