flutter_file_picker icon indicating copy to clipboard operation
flutter_file_picker copied to clipboard

Can you change the way it runs on macOS?

Open rigroch opened this issue 2 years ago • 5 comments

In summary, use Channel like iOS.

Please use beginSheetModal instead of runModal. (runModal works the same as the way uses osascript you were written.)

guard let keywindow = NSApplication.shared.keyWindow else {
    result(nil)
    return
}

NSOpenPanel().beginSheetModal(for: keywindow) { response in
    
}

It appears more beautiful appearance, and to solve the issue.

rigroch avatar Oct 07 '22 02:10 rigroch

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Oct 18 '22 02:10 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 01 '22 02:11 github-actions[bot]

runModal works the same as the way uses osascript you were written.

This isn't actually correct; an in-process runModal call would already be vastly better than osascript. The latter is not intended for use in GUI applications, and shows the dialog in a completely separate process, which creates significant issues around focus and window management.

stuartmorgan avatar Nov 11 '22 11:11 stuartmorgan

Any updates on this? It would be really nice if the the lockParentWindow would actually work on macOS.

Docs for runModal: https://developer.apple.com/documentation/appkit/nsapplication/1428436-runmodal

ricardoboss avatar Dec 04 '23 12:12 ricardoboss

I imagine this would also fix https://github.com/miguelpruivo/flutter_file_picker/issues/1445

Hixie avatar Feb 13 '24 22:02 Hixie

Closing this issue as a duplicate of https://github.com/miguelpruivo/flutter_file_picker/issues/1492 since that issue has a better explanation of what needs to change.

navaronbracke avatar Apr 18 '24 20:04 navaronbracke