convert cys file into txt flutter
Future<List<String>> 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<File> writeToFile(ByteData data, String path) {
return File(path).writeAsBytes(data.buffer.asUint8List(
data.offsetInBytes,
data.lengthInBytes,
));
}