writeJson method
Write data to a JSON file
Implementation
Future<void> writeJson(
String path,
dynamic data, {
bool pretty = true,
}) async {
String content;
if (pretty) {
content = const JsonEncoder.withIndent(' ').convert(data);
} else {
content = jsonEncode(data);
}
await writeFile(path, content);
}