Open rezadevelopers2 opened 5 months ago
I'm facing this issue, anyone found a solution??
It is mentioned in the README that "you can call saveAs() only available for android and iOS & macOS at the moment". There is a simple workaround, but ideally this would be addressed inside the plugin itself.
final filePath = await FileSaver.instance.saveAs(
name: fileName,
bytes: Uint8List(),
ext: ".$extension",
mimeType: mimeType,
);
if (filePath == null) {
// cancelled prompt
return;
}
// TODO FileSaver.instance.saveAs() as of 0.2.13 on Windows
// only prompts the user for the desired file location, but does not write
// the file passed in.
if (Platform.isWindows) {
final file = File(filePath);
await file.writeAsBytes(fileModel.data);
}
If the maintainers need some help with implementing this, I have some time to address this issue.
`
`
This code works correctly for Android But for the Windows and web version, the file is not saved and does not give any error