Skip to content

Instantly share code, notes, and snippets.

@fabioCollini
Created September 19, 2021 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabioCollini/49462cb895802b2c3f7e98764e072aa2 to your computer and use it in GitHub Desktop.
Save fabioCollini/49462cb895802b2c3f7e98764e072aa2 to your computer and use it in GitHub Desktop.
@Composable
fun Calculator(state: CalculatorViewModel) {
Column {
TextField(value = state.v1.collectAsState().value, onValueChange = { state.v1.value = it })
TextField(value = state.v2.collectAsState().value, onValueChange = { state.v2.value = it })
Text(text = state.result.collectAsState().value)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment