writeLines static method

Future<void> writeLines(
  1. String path,
  2. List<String> lines
)

将字符串列表写入文件。

Implementation

static Future<void> writeLines(String path, List<String> lines) async {
  File file = File(path);
  await file.writeAsString(lines.join('\n'));
}