getFile method

Future<String> getFile(
  1. String jsonString
)

Implementation

Future<String> getFile(String jsonString) async {
  var applicationDirectory = await getApplicationDocumentsDirectory();
  final String location = '${applicationDirectory.path}/my_app.json';
  final File file = File(location);
  await file.writeAsString(jsonString);
  return location;
}