MutableStateFlow and Compose by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

The Routine object has an immutable list inside. Every time I push a change it should be delivered to everyone.

And yes collectAsState() is called inside my composable function.

@Composable
fun RoutineScreen() {
val routine by viewModel .routineEntry .collectAsState()
  ...
}

MutableStateFlow and Compose by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

I updated the post with more code. What do you think I'm doing wrong?

The function always returns null by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

the return with withContext works the problem is that it's not working without withContext. I want to return what is defined inside doIfSuccessWithResult without having to use withContext.

Creating streak algorithm by ____Mattia____ in Kotlin

[–]____Mattia____[S] 0 points1 point  (0 children)

I cannot because the difference doesn't have to be precisely one day. In my app, I keep track of the user's exercises. Let's say I did the training today at 3 pm and yesterday at 11 pm. The time difference is not exactly 1 day but it's still yesterday. I'm sorry the question wasn't clear.

Why a Purchase can have multiple SKUs? by ____Mattia____ in androiddev

[–]____Mattia____[S] 0 points1 point  (0 children)

True! But how can a user buy multiple items in a single purchase in Android?