writeFileString static method

Future<File> writeFileString(
  1. String filename,
  2. String content, {
  3. bool recursive = false,
})

Implementation

static Future<File> writeFileString(
  String filename,
  String content, {
  bool recursive = false,
}) async {
  final file = await getFile(filename);
  await file.create(recursive: recursive);
  final raf = file.openSync(mode: FileMode.write)..writeStringSync(content);
  await raf.close();

  return file;
}