-
Notifications
You must be signed in to change notification settings - Fork 716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getDirectoryPath not open selection window #1704
Comments
I'm seeing something similar but with 8.1.4. |
I think the issue is that the private func handleDirectorySelection(
_ call: FlutterMethodCall, result: @escaping FlutterResult
) {
Task { @MainActor in
let dialog = NSOpenPanel()
let args = call.arguments as! [String: Any]
dialog.directoryURL = URL(
fileURLWithPath: args["initialDirectory"] as? String ?? ""
)
dialog.showsHiddenFiles = false
dialog.allowsMultipleSelection = false
dialog.canChooseDirectories = true
dialog.canChooseFiles = false
if dialog.runModal() == NSApplication.ModalResponse.OK {
if let url = dialog.url {
result(url.path)
return
}
}
// User dismissed the dialog
result(nil)
}
} I can submit a PR to do this for the other functions if @miguelpruivo agrees this is the right solution. |
Same issue on my Mac If I use the example code: String? selectedDirectory = await FilePicker.platform.getDirectoryPath();
|
@Zhoucheng133 does this fork work for you? |
I use previous version and it works! file_picker: 8.1.7 # without ^ |
@Zhoucheng133 It would be interesting to see if that branch fixes your issue because rolling back to an old version is not a long term solution. |
I have tried your fork and it does not worked as well ;w; ![]() ![]() |
@Zhoucheng133 thanks for trying it. Is your app running with app sandbox enabled? |
Describe the bug
await FilePicker.platform.getDirectoryPath()
doesn't pop up selection windowPlatform
Platform OS version
MacOS 15.3
Flutter 3.27.3
Dart 3.6.1
file_picker 8.3.3
How are you picking?
Details to reproduce the issue
You can use the code above
Error Log
No error but it just returns null without opening up selection window.
Flutter Version details
Additional context
Roll back to
8.1.7
works well.The text was updated successfully, but these errors were encountered: