mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 22:37:03 +05:30
Add broken reactivity
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
405cf34193
commit
bfdc4b3183
1 changed files with 5 additions and 2 deletions
|
@ -10,6 +10,8 @@ import androidx.compose.material.ListItem
|
|||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Switch
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
|
@ -20,6 +22,7 @@ import dev.msfjarvis.todo.data.TodoItem
|
|||
@Suppress("Unused")
|
||||
@Composable
|
||||
fun LazyItemScope.WireGuardItem(item: TodoItem) {
|
||||
var checked by remember { mutableStateOf(false) }
|
||||
Row(
|
||||
modifier = Modifier.padding(vertical = 8.dp).fillParentMaxWidth(),
|
||||
) {
|
||||
|
@ -42,8 +45,8 @@ fun LazyItemScope.WireGuardItem(item: TodoItem) {
|
|||
},
|
||||
trailing = {
|
||||
Switch(
|
||||
checked = false,
|
||||
onCheckedChange = { },
|
||||
checked = checked,
|
||||
onCheckedChange = { checked = !checked },
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue