Created
March 30, 2023 20:48
-
-
Save tfaki/e07720475f2c02f101e296a05d455c96 to your computer and use it in GitHub Desktop.
Modifier Run Block
This file contains hidden or 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
@Composable | |
fun WithRunBlock() { | |
var isExpanded by remember { | |
mutableStateOf(true) | |
} | |
Box( | |
modifier = Modifier | |
.height(50.dp) | |
.run { | |
if (isExpanded) { | |
isExpanded = false | |
fillMaxWidth() | |
} else { | |
fillMaxWidth(0.5f) | |
} | |
} | |
.background(Color.Red) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment