writeFile static method

Future<File> writeFile(
  1. String path,
  2. String content
)

将内容写入文件。

Implementation

static Future<File> writeFile(String path, String content) async {
  File file = File(path);
  return file.writeAsString(content);
}