-
-
Save saqib-github-commits/52c92bed2be72f579d6bab8326c3bcf0 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
@Composable | |
fun RememberCoroutineScopeTestScreen ( ) { | |
Column( | |
modifier = Modifier.fillMaxSize(), | |
verticalArrangement = Arrangement.Center, | |
horizontalAlignment = Alignment.CenterHorizontally | |
) { | |
val coroutineScope = rememberCoroutineScope() | |
var counter by remember { mutableStateOf(0) } | |
Text(text = counter.toString()) | |
Spacer(modifier = Modifier.height(8.dp)) | |
Button( | |
onClick = { | |
coroutineScope.launch { | |
counter += 1 | |
} | |
} | |
) { | |
Text(text = "Button") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment