Hi! I have a fragment and inside it there is a `Co...
# compose
a
Hi! I have a fragment and inside it there is a
ComposeView
. Could I use this composeView for two types of Composable dialogs which is shown on the screen dynamically depending on backend results? Or should I use one composeView per one type of dialogs?
m
Of course, why not! Emit whatever UI you need based on your backend results.
☝🏻 1
You can do it in one ComposeView.
a
I’m getting
isDialogVisible was not initialized
for some season, when using only one composeView for them. I tried to initialise the above variable by using: 1.
private lateinit var isDialogVisible: MutableState<Boolean>
and then
isDialogVisible.value = true
2.
private var isDialogVisible by mutableStateof(value = false)
and then just
isDialogVisible = true
the above cases work fine when I have one ComposeView and one type of dialog per screen. Medhi, thanks for sharing your ideas. I’ll try to review this behaviour again tomorrow