Mohamed Ibrahim
04/02/2023, 1:12 PMviewModel.login(email, pass)
function, but there’s a weird behavior where with every keystroke on the email or password field .. the ViewModel function get triggered. any idea how to solve that?
var email = rememberSaveable { mutableStateOf("") }
var password = rememberSaveable { mutableStateOf("") }
Button(
onClick = {
viewModel.login(email.value, password.value)
},
enabled = uiState.value !is LoginResult.Loading,
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp)
) {
Text("Login")
}
Chris Fillmore
04/02/2023, 3:54 PMMohamed Ibrahim
04/02/2023, 4:21 PMChris Fillmore
04/02/2023, 4:57 PMMohamed Ibrahim
04/02/2023, 5:15 PM