mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 05:37:02 +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.MaterialTheme
|
||||||
import androidx.compose.material.Switch
|
import androidx.compose.material.Switch
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
@ -20,6 +22,7 @@ import dev.msfjarvis.todo.data.TodoItem
|
||||||
@Suppress("Unused")
|
@Suppress("Unused")
|
||||||
@Composable
|
@Composable
|
||||||
fun LazyItemScope.WireGuardItem(item: TodoItem) {
|
fun LazyItemScope.WireGuardItem(item: TodoItem) {
|
||||||
|
var checked by remember { mutableStateOf(false) }
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(vertical = 8.dp).fillParentMaxWidth(),
|
modifier = Modifier.padding(vertical = 8.dp).fillParentMaxWidth(),
|
||||||
) {
|
) {
|
||||||
|
@ -42,8 +45,8 @@ fun LazyItemScope.WireGuardItem(item: TodoItem) {
|
||||||
},
|
},
|
||||||
trailing = {
|
trailing = {
|
||||||
Switch(
|
Switch(
|
||||||
checked = false,
|
checked = checked,
|
||||||
onCheckedChange = { },
|
onCheckedChange = { checked = !checked },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue