1

I can't find a right way to use dialogs in compose. For example I have a common bottom sheet dialog with options list. I created an OptionsDialog widget, OptionsDialogState (list of options like: title, icon and etc) and rememberSaveable function for this state. Created LocalOptionDialogSate with compositionLocalOf. I placed OptionsDialog in the root of my UI tree. Now I can easily call this dialog with custom options anywhere in my app via LocalOptionDialogSate. But I steel need to pass action lambda for each option. And there is a problem. I can't save/restore (rememberSaveable) state with function properties. How do I need to pass actions block (like () -> Unit) to the dialog?

0 Answers0