-
Notifications
You must be signed in to change notification settings - Fork 840
Description
I'm developing a Flutter application that saves images to external storage as one of its activities. When I use an Android emulator, FilePicker.platform.saveFile allows selecting a folder and a filename, then saves data (parameter bytes) there. But when I run the Linux app (my dev machine is running Kubuntu 25.04), I select a folder and a filename, no exception is thrown, everything looks good, but the file is not there (or not overwritten if it existed before). When googling a solution, the AI-generated result mentioned that I have to save the file myself: await File(path).writeAsBytes(bytes);
So, at the moment, I'm passing Uint8List(0) as bytes to FilePicker.platform.saveFile(...), then saving as above.
But why is it asymmetric? And what's the point of requiring a non-null array of bytes if it is not always used?
Package version: 10.3.3 (at the moment, the latest).
Platform: Desktop (Linux)
Platform OS version: Kubuntu 25.04
How are you picking?
var outFilePath = await FilePicker.platform.saveFile(
dialogTitle: 'Save Image As',
type: FileType.image,
allowedExtensions: ['png',],
fileName: 'test.png',
bytes: bytes, // obtained before
);
Details to reproduce the issue: just confirm it works under every target platform the same way.