What is the right way to provide state for a speci...
# compose
l
What is the right way to provide state for a specific item of a
LazyColumn
? Currently the state is applied to all items. Example code:
Copy code
@Composable
private fun ScannerList(
    items: List<DiscoveredBluetoothDevice>,
    connectionState: ConnectionState, // StateFlow in view model
) { ...

private fun ScannerListItem(
    connectionState: ConnectionState,
    ...
) {
    ListItem(
       trailing = {
           Button(onClick = {  // trigger change of connectionState in view model })
           val iconColor: Color = when (connectionState) { ConnectionState.Connected -> Green600 ... }
       }
    ) 
}
Do I have to narrow down
List<DiscoveredBluetoothDevice>
so I get sth like
List<DiscoveredBluetoothDeviceItem>
?