📜  将 cys 文件转换为 txt 颤振 - 任何代码示例

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

代码示例1
Future> getFileLines() async {
  final data = await rootBundle.load('assets/bot.txt');
  final directory = (await getTemporaryDirectory()).path;
  final file = await writeToFile(data, '$directory/bot.txt');
  return await file.readAsLines();
}

Future writeToFile(ByteData data, String path) {
  return File(path).writeAsBytes(data.buffer.asUint8List(
    data.offsetInBytes,
    data.lengthInBytes,
  ));
}