json_printer 0.0.3
json_printer: ^0.0.3 copied to clipboard
A Flutter package to print JSON objects sequentially, designed with SOLID principles in mind. This package is useful for developers who need a structured and readable way to output JSON data in their [...]
import 'package:json_printer/json_printer.dart';
void main() {
Map<String, dynamic> patientResponse = {
"hospitalNumber": "123456",
"name": "John Doe",
"age": 30,
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "Anystate",
},
"phoneNumbers": ["234-1234", "234-5678"],
};
IJsonFormatter formatter = JsonFormatter(); // Create an instance of JsonFormatter
IJsonPrinter printer = JsonPrinter(formatter); // Create an instance of JsonPrinter with the formatter
printer.printJson(patientResponse); // Print the JSON
}