Last active
May 21, 2024 20:11
-
-
Save AlexeyKorshun/1fda50c1efd33cbb5d57e866b0554925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Contact(val name: String, val phones: List<String>) | |
@Composable | |
fun ContactRow(contactFlow: StateFlow<Contact>, modifier: Modifier = Modifier) { | |
var selected by remember { mutableStateOf(false) } | |
val contact = contactFlow.collectAsState() | |
Row(modifier) { | |
ContactDetails(contact.value) | |
ToggleButton(selected, onToggled = { selected = !selected }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment