https://kotlinlang.org logo
#compose
Title
# compose
l

Lukasz Kalnik

11/25/2021, 3:45 PM
Currently I have the problem that the preview doesn't work. For the preview I create a fake uiState:
Copy code
@Preview
@Composable
fun NameDialogPreview() {
    val uiState = mutableStateOf(
        NameDialogState(
            show = true, 
            nameFieldValue = TextFieldValue(text = "My name")
        )
    )
    NameDialog(uiState = uiState)
}
But it doesn't show anything.
a

Adam Powell

11/25/2021, 3:59 PM
it's been a while since I tried so my info may be out of date, but last I checked, dialogs and popups weren't supported in previews
☝️ 1
l

Lukasz Kalnik

11/25/2021, 4:02 PM
Ah, that explains it! Thank you 🙏
👍 1
8 Views