You can use kdialog or zenity to run a standalone file chooser from the command line. For applications that want to integrate an external chooser, they can use the flatpak file chooser portal. Of course the caveat with these is, your application can no longer put custom widgets in the file chooser, because it is now an external process.