Chachako
04/25/2022, 3:10 PMagrosner
04/25/2022, 3:29 PMif
statement on a state valueAlbert Chang
04/25/2022, 4:29 PMCasey Brooks
04/25/2022, 4:36 PMby remember { mutableStateOf(false) }
right at the dialog, but you may also want to lift that state to the parent composable. You may wish to manage it from the root of the screen through the MVI pattern, or even listen to a websocket to know when to show/hide the dialog. If the dialog was displayed imperatively, then these more complex use-cases would end up managing what the state of the dialog should be, but also needing to have intimate knowledge of the current UI state to know how to synchronize the two.
Or, you just let Compose do the synchronization of state to UI elements, and you just declare that you want a dialog to be visible or not. Which is what it we’ve got currently.