Skip to content

Instantly share code, notes, and snippets.

@burnoo
Last active April 4, 2022 16:30
Show Gist options
  • Save burnoo/0d399c29d1ecfb8c35e82ac116af0aa5 to your computer and use it in GitHub Desktop.
Save burnoo/0d399c29d1ecfb8c35e82ac116af0aa5 to your computer and use it in GitHub Desktop.
Two-way data binding in Jetpack Compose 1
class ViewModel {
private val _password = MutableStateFlow<String>("")
val password: StateFlow<String> = _password
fun onPasswordChanged(password: String) {
_password.value = password
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment