Closed Lutra-Fs closed 2 months ago
On Linux I do not see a default filename provided when I tap the SAVE button
I can provide a screenshot.
test on Linux. Zenity is the default file manager file-picker
trying to use and it seems without your issue.
See https://github.com/miguelpruivo/flutter_file_picker/issues/1451 We also may need to add zenity as an optional dependency to provide save function
When I click SAVE in the SCRIPT tab the default filename is listed there. May need to check what the difference is.
They look pretty much identical to me: lib/utils/select_file.dart
and lib/tabs/script/save_button.dart
:
String? result = await FilePicker.platform.saveFile(
dialogTitle: 'Save SVG image to a .svg file',
fileName: defaultFileName,
type: FileType.custom,
allowedExtensions: ['svg'],
);
and
String? outputPath = await FilePicker.platform.saveFile(
dialogTitle: 'Choose a file to save',
fileName: 'script.R',
type: FileType.custom,
allowedExtensions: ['R'],
);
That's odd that the first does not work but the second does. This is on Ubuntu 24.04 running Gnome.
Tried a few alternatives. None worked yet. Tested on Lab Linux:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Couldn't find the executable zenity in the path.
#0 isExecutableOnPath (package:file_picker/src/utils.dart:60)
<asynchronous suspension>
#1 FilePickerLinux._getPathToExecutable (package:file_picker/src/linux/file_picker_linux.dart:127)
<asynchronous suspension>
#2 FilePickerLinux.saveFile (package:file_picker/src/linux/file_picker_linux.dart:91)
<asynchronous suspension>
#3 selectFile (package:rattle/utils/select_file.dart:36)
<asynchronous suspension>
#4 ImagePage.build.<anonymous closure>.<anonymous closure> (package:rattle/widgets/image_page.dart:165)
<asynchronous suspension>
** (rattle:2109544): WARNING **: 20:26:43.615: Attempted to set message handler on an FlBinaryMessenger without an engine
** (rattle:2109544): WARNING **: 20:26:43.615: Attempted to set message handler on an FlBinaryMessenger without an engine
We may need to revert to simply asking for a filename in a text field popup until this issue is resolved, perhaps upstream if that's where the problem is? https://github.com/miguelpruivo/flutter_file_picker/issues/1451
Pull Request Details
What issue does this PR address
extract the current file name used in temp as the default file name for file picker
Link to associated issue: #395
Checklist
Complete the check-list below to ensure your branch is ready for PR.
Flutter Style Guide: https://survivor.togaware.com/gnulinux/flutter-style.html
make prep
orflutter analyze lib
)Finalising
Once PR discussion is complete and reviewer has approved: