I passed a list of data to a composable function (data object of type Flow<List<Device>>
). I used flow method collectAsState
inside composable to use this data as state, and I can see the list in the emulator after building the application. Mind you, compose preview panel does not show the fake data that I passed to the composable.
@Preview
@Composable
PreviewHomeScreen() {
val devices = flow { emit(
listOf(Device(1, "Device Name 1"), Device(2, "Device Name 2"))
)}
HomeScreen(devices)
}
Is there any work that the preview window can show the data of type Flow?