Skip to content

Instantly share code, notes, and snippets.

@dhruvilp
Created November 22, 2022 23:02
Show Gist options
  • Save dhruvilp/6ec264306cebee9ac224cc07b04c17e3 to your computer and use it in GitHub Desktop.
Save dhruvilp/6ec264306cebee9ac224cc07b04c17e3 to your computer and use it in GitHub Desktop.
Dart JSON Pretty print
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