Skip to content

Commit

Permalink
Fixing save
Browse files Browse the repository at this point in the history
  • Loading branch information
deathblade666 committed Aug 30, 2024
1 parent 801c26f commit 8199028
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/pages/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,19 @@ class Menu extends StatefulWidget {
final result = (await FlutterFileDialog.pickFile());

// await CRFileSaver.saveFileWithDialog(SaveFileDialogParams(sourceFilePath: '/sdcard/Downloads', destinationFileName: destinationFileName))
final XFile textfile = XFile.fromData(bytes);
await textfile.saveTo(result!);
//final XFile textfile = XFile.fromData(bytes);
//await textfile.saveTo(result!);
//String path = result;
//var file = File(outputfile!);
//var sink = file.openWrite();
//sink.add(bytes);
var file = File(result!);
var sink = file.openWrite();
sink.add(bytes);

showDialog(
context: context,
builder: (BuildContext context){
return AlertDialog(
title: const Text("Success"),
content: Text("Save successfully to $result"),
content: Text('Save successfully to $result'),
);
}
);
Expand Down

0 comments on commit 8199028

Please sign in to comment.