```val uiState by viewModel.loginUiState.collectAs...
# compose-android
n
Copy code
val uiState by viewModel.loginUiState.collectAsStateWithLifecycle()

var isOfferChecked by rememberSaveable { mutableStateOf(false) }
val isLoginButtonEnabled by remember {
    derivedStateOf {
        uiState.login.isNotBlank() && uiState.password.isNotBlank() && isOfferChecked
    }
}

  private var _loginUiState = MutableStateFlow(LoginUIState())
    val loginUiState: StateFlow<LoginUIState> = _loginUiState.asStateFlow()

Hello!

Is something wrong with using derivedStateOf here?
h
What do you mean "Is something working" with the
derivedStateOf
? Do you mean, how does it work, or, what does this do?
y
Hi Nurlibay, your question is a bit unclear. It would help if you could structure it more clearly. For example, you could: • Separate the UI (Composable) part and the ViewModel logic. • Include relevant code snippets to show exactly what you're working with. • Clearly state your goal or the specific issue you're facing at the end. This way, the Slack Community can better understand your problem and provide more helpful answers.
n
Sorry not "working", "wrong"
y
I think, you have to add your parameters to remember like this: remember(uiState.login, uiState.password, isOfferChecked) { ... }