📜  dart 写入文件 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:20.785000             🧑  作者: Mango

代码示例1
main() async {
  List letters = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"];
  File file = new File("Letters.txt");
  for (int i = 0; i < 10; i++) {
    await file.writeAsString("${letters[i]}", mode: FileMode.append);
  }
}