saveJsonFromPath function

Future<void> saveJsonFromPath(
  1. String path,
  2. dynamic data
)

Implementation

Future<void> saveJsonFromPath(String path, dynamic data) async {
  final file = File(path);
  if (!await file.exists()) {
    await file.create(recursive: true);
  }
  await file.writeAsString(json.encode(data));
}