flutter_file_picker
flutter_file_picker copied to clipboard
Linux file picker not working in build release
Describe the bug file picker is working fine in debug mode but when creating snap for linux the file picker is not working
Platform
- [ ] Android
- [ ] iOS
- [ ] Web
- [x] Desktop
Platform OS version Ubuntu 22.04 LTS
How are you picking?
Future<File> getFile(List<String> type) async {
FilePickerResult? file = await FilePicker.platform.pickFiles(
allowedExtensions: type,
type: FileType.custom,
allowMultiple: false,
withReadStream: true);
if (file != null) {
return File(file.files.first.path!);
} else {
throw Exception("File is not seleted");
}
}
Details to reproduce the issue create snap for the project Error throwing in snap flutter:Exception: Couldn't find the executable zenity in the path
This issue is stale because it has been open for 14 days with no activity.
@miguelpruivo ?
This issue is stale because it has been open for 14 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
@alihassan143 same problem, have you found a solution?
@Haidar0096 user file selector official flutter plugin working without any issue in any desktop also it provide more flexibility is the picking and saving files
@alihassan143
@Haidar0096 user file selector official flutter plugin working without any issue in any desktop also it provide more flexibility is the picking and saving files
Thank you I will have a look, but did you find a solution to the problem? As I already implemented my app using file_picker?
it works on other platforms but did not works in linux build @Haidar0096 you have to only change one function if you make and reusable picked file functions like this
Future<File> getFile(List<String> type) async {
final XTypeGroup typeGroup = XTypeGroup(
extensions: type,
);
final XFile? file = await openFile(acceptedTypeGroups: <XTypeGroup>[typeGroup]);
if (file != null) {
return File(file.path);
} else {
throw Exception("File is not seleted");
}
}`
Same problem