I am building an app and this app is for scanning barcodes and the user will enter some info and in the last page I want to show that data(date, number of bottles,the place,the barcodes) in text fields and there will be a button and by clicking that button i want to create a text file and write that data on the file and then exit to the first page. How to make the last step which is to create the file and write the data to the file? I tried a lot of things like this
Future<String> getLocalPath () async {
var folder= await getApplicationDocumentsDirectory();
return folder.path;
}
saveInfo(){
String path1= 'selectedDate.txt';
Future<File> myFile = File(path1).create(recursive: true);
print(path1);
}
but did not work!!!