Dialog settings
Customize the dialogs with platform-specific settings
FileKit allows you to customize dialog behavior with platform-specific settings. Each platform has its own settings class that can be configured according to your needs.
Platform-Specific Settings
JVM Settings
On JVM platforms (Windows, macOS, Linux), you can customize:
parentWindow
: Set the parent window for the dialog (useful for modal behavior)macOS
: Configure macOS-specific settings
For desktop applications, it’s recommended to pass the window reference:
macOS Settings
On macOS, you can configure:
canCreateDirectories
: Allow or prevent directory creation in dialogs (default: true)
Android, Web, and WASM
These platforms currently don’t have any specific settings to configure. Use the default settings:
Using DialogSettings in KMP
When working with Kotlin Multiplatform projects, you might need to handle platform-specific settings differently. Here’s how to use expect/actual to manage dialog settings:
For platforms that need specific configuration, use expect/actual:
You can then use the platform-specific settings in your shared code:
This approach allows you to:
- Keep your common code platform-agnostic
- Provide platform-specific configurations where needed
- Maintain type safety across platforms
Platform-specific settings are continuously evolving. You can ask for a feature or report a bug on the GitHub repository.