Answers for "convert cys file into txt flutter"

0

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,
  ));
}
Posted by: Guest on June-01-2021

Code answers related to "convert cys file into txt flutter"

Browse Popular Code Answers by Language